[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Fri Mar 3 10:32:27 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar  3 09:55:34 2017 +0100| [10496dfcde35d6318aa75dbeac35a8418e9deb3a] | committer: Geoffrey Métais

Prevent NPE

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java        | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index a6bf197..b6fa007 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1765,8 +1765,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         final IVLCVout vlcVout = mService.getVLCVout();
         if (vlcVout.areViewsAttached() && voutCount == 0) {
             mHandler.postDelayed(mSwitchAudioRunnable, 4000);
-        } else if (voutCount > 0)
-            mFov = mService.getCurrentVideoTrack().projection == Media.VideoTrack.Projection.Rectangular ? 0f : 80f;
+        } else if (voutCount > 0) {
+            Media.VideoTrack vt = mService.getCurrentVideoTrack();
+            if (vt != null)
+                mFov = vt.projection == Media.VideoTrack.Projection.Rectangular ? 0f : 80f;
+        }
     }
 
     public void switchToPopupMode() {



More information about the Android mailing list