[Android] Prevent NPE when view is not initialized

Geoffrey Métais git at videolan.org
Mon Jun 6 14:40:42 CEST 2016


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

Prevent NPE when view is not initialized

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

 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