[Android] Prevent NPE when view is not initialized

Geoffrey Métais git at videolan.org
Mon Jun 6 17:10:01 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jun  6 14:23:33 2016 +0200| [f8afd8afef07b2f09869484c7419d2170dcd7f63] | committer: Geoffrey Métais

Prevent NPE when view is not initialized

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

 vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java b/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java
index e55fe62..6af493c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java
+++ b/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java
@@ -140,6 +140,8 @@ public class PopupLayout extends RelativeLayout implements ScaleGestureDetector.
 
     @Override
     public boolean onTouch(View v, MotionEvent event) {
+        if (mWindowManager == null)
+            return false;
         if (mScaleGestureDetector != null)
             mScaleGestureDetector.onTouchEvent(event);
         if (mGestureDetector != null && mGestureDetector.onTouchEvent(event))



More information about the Android mailing list