-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE In BottomSheetBehaviour.onInterceptTouchEvent #43
Comments
We are also able to reproduce this crash on Samsung Galaxy Tab. We have support library |
We had the same issue on Samsung "Galaxy Tap Pro 8.4" (device name copy-pasted from Fabric – no typo here), Android 4.4.2, Support Library 26.1.0. |
Having the same issue. NPE is caused by this line in BottomSheetBehavior on line 299 in onInterceptTouchEvent():
mNestedScrollingChildRef is null in some cases. May just need to create your own BottomSheetBehavior with everything the same except for a nestedScrollingChildRef null check before this line. If it's null, just return false I guess. Gonna try that now. |
This appears to have been fixed in support library 28.0.0, or material library 1.0.0 (same thing, just support vs androidx). |
This issue has been fixed in this commit 24c40ff and has been available since version 1.0.0 |
There's another issue related to this, we're seeing onStopNestedScroll get called before the view is laid out. However there's a block in this method where Then in
Because viewRef hasn't been assigned |
That NPE appears to be different. That's for the nested scroller. There's a report of this still happening in 28.0.0 some middle versions seem like they were fixed. But the latest version actually doesn't seem to do the explicit check anymore. See: |
We're seeing a huge influx of these NPEs. We're using version 28.0.0 as well and have many bottom sheets in the app so it's pretty hard to know where it's coming from:
Is anyone else seeing this? |
Overview
NullPointerException when attempting to delegate
onInterceptTouchEvents
to aBottomSheet
beforeonLayoutChild
has been called.https://github.com/material-components/material-components-android/blob/master/lib/src/android/support/design/widget/BottomSheetBehavior.java#L281
The view reference is not checked before being interacted with, which the
MotionEvent.ACTION_DOWN
case is doing.Reproduction steps
This can occur on older/slower devices by spamming touch events to the bottom sheet whilst the layout is being constructed.
Version number
Operating system and device
Am able to consistently reproduce on a Samsung S7 7.0.
Was originally reported via crashyltics on Samsung Galaxy J1 4.4.4 and Oppo A37fw 5.1.1
The text was updated successfully, but these errors were encountered: