[Android] Video player: prevent NPE

Geoffrey Métais git at videolan.org
Thu Feb 21 17:01:28 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 21 16:57:26 2019 +0100| [c02f9ab011de8ac2484fa58ee7b0d5762beec9ed] | committer: Geoffrey Métais

Video player: prevent NPE

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 96dafd318..94890277b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2031,6 +2031,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
     }
 
     public void pickSubtitles() {
+        if (mUri == null) return;
         mShowingDialog = true;
         final Intent filePickerIntent = new Intent(this, FilePickerActivity.class);
         filePickerIntent.setData(Uri.parse(FileUtils.getParent(mUri.toString())));
@@ -2224,7 +2225,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
                 showControls(true);
             }
             dimStatusBar(false);
-            mHudBinding.progressOverlay.setVisibility(View.VISIBLE);
+            if (mHudBinding != null) mHudBinding.progressOverlay.setVisibility(View.VISIBLE);
             if (!mDisplayManager.isPrimary())
                 mOverlayBackground.setVisibility(View.VISIBLE);
             updateOverlayPausePlay();



More information about the Android mailing list