[Android] VideoHelper: prevent NPE

Geoffrey Métais git at videolan.org
Mon Feb 25 10:23:10 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 25 10:12:55 2019 +0100| [b6d6c2608d9d1f6b5eece4d1652314949f4aa16b] | committer: Geoffrey Métais

VideoHelper: prevent NPE

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

 libvlc/src/org/videolan/libvlc/VideoHelper.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libvlc/src/org/videolan/libvlc/VideoHelper.java b/libvlc/src/org/videolan/libvlc/VideoHelper.java
index 6ce42385a..3e0019c5a 100644
--- a/libvlc/src/org/videolan/libvlc/VideoHelper.java
+++ b/libvlc/src/org/videolan/libvlc/VideoHelper.java
@@ -89,8 +89,9 @@ class VideoHelper implements IVLCVout.OnNewVideoLayoutListener {
             vlcVout.setVideoView(mVideoSurface);
             if (mSubtitlesSurface != null)
                 vlcVout.setSubtitlesView(mSubtitlesSurface);
-        } else
+        } else if (mVideoTexture != null)
             vlcVout.setVideoView(mVideoTexture);
+        else return;
         vlcVout.attachViews(this);
 
         if (mOnLayoutChangeListener == null) {



More information about the Android mailing list