[Android] Prevent NPE on audio player loading
Geoffrey Métais
git at videolan.org
Mon Apr 3 11:53:36 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 3 11:52:59 2017 +0200| [9511a36378dc13321c9f0055dd12489b73db11f8] | committer: Geoffrey Métais
Prevent NPE on audio player loading
> https://code.videolan.org/videolan/vlc-android/commit/9511a36378dc13321c9f0055dd12489b73db11f8
---
.../src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java | 7 +++++++
1 file changed, 7 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 6f2d7c3..52aff3e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.java
@@ -34,4 +34,11 @@ public class BottomSheetBehavior<V extends View> extends android.support.design.
//Same crash, weakref not already set.
}
}
+
+ @Override
+ public boolean onTouchEvent(CoordinatorLayout parent, V child, MotionEvent event) {
+ try {
+ return super.onTouchEvent(parent, child, event);
+ } catch (NullPointerException ignored) {}
+ }
}
More information about the Android
mailing list