[Android] Catch another BottomSheetBehavior NPE

Geoffrey Métais git at videolan.org
Fri Mar 3 10:32:26 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar  3 09:51:06 2017 +0100| [efa21e38f7f673b50f69f3cae934206940481a64] | committer: Geoffrey Métais

Catch another BottomSheetBehavior NPE

> https://code.videolan.org/videolan/vlc-android/commit/efa21e38f7f673b50f69f3cae934206940481a64
---

 .../src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java b/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java
index 618d80b..6f2d7c3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java
@@ -25,4 +25,13 @@ public class BottomSheetBehavior<V extends View> extends android.support.design.
             return false;
         }
     }
+
+    @Override
+    public void onStopNestedScroll(CoordinatorLayout coordinatorLayout, V child, View target) {
+        try {
+            super.onStopNestedScroll(coordinatorLayout, child, target);
+        } catch (NullPointerException ignored) {
+            //Same crash, weakref not already set.
+        }
+    }
 }



More information about the Android mailing list