[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Thu Feb 2 09:59:29 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb  2 09:30:44 2017 +0100| [81bd814eaef78939a87136331e652c4aadb71036] | committer: Geoffrey Métais

Prevent NPE

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

 libvlc/src/org/videolan/libvlc/AWindow.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libvlc/src/org/videolan/libvlc/AWindow.java b/libvlc/src/org/videolan/libvlc/AWindow.java
index 4fceecf..564ed0b 100644
--- a/libvlc/src/org/videolan/libvlc/AWindow.java
+++ b/libvlc/src/org/videolan/libvlc/AWindow.java
@@ -124,7 +124,7 @@ public class AWindow implements IVLCVout {
         }
 
         public void release() {
-            if (AndroidUtil.isICSOrLater())
+            if (AndroidUtil.isICSOrLater() && mSurface != null)
                 mSurface.release();
             mSurface = null;
             setNativeSurface(mId, null);



More information about the Android mailing list