Skip to content

Commit 9c11d35

Browse files
Material Design Teamdsn5ft
Material Design Team
authored andcommitted
Prevent potential NPE. It's reported in live AGSA bugs and the root cause could be the same with cl/152195381.
PiperOrigin-RevId: 181238092
1 parent 2885fc7 commit 9c11d35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/java/android/support/design/widget/BottomSheetBehavior.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public boolean onInterceptTouchEvent(CoordinatorLayout parent, V child, MotionEv
303303
// We have to handle cases that the ViewDragHelper does not capture the bottom sheet because
304304
// it is not the top most view of its parent. This is not necessary when the touch event is
305305
// happening over the scrolling content as nested scrolling logic handles that case.
306-
View scroll = nestedScrollingChildRef.get();
306+
View scroll = nestedScrollingChildRef != null ? nestedScrollingChildRef.get() : null;
307307
return action == MotionEvent.ACTION_MOVE
308308
&& scroll != null
309309
&& !ignoreEvents

0 commit comments

Comments
 (0)