[Android] Video player: prevent NPE on switch to popup

Geoffrey Métais git at videolan.org
Wed Nov 8 10:54:44 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov  8 10:06:29 2017 +0100| [366c152040df2ae424c71d23e2ee87e3a5eaeba1] | committer: Geoffrey Métais

Video player: prevent NPE on switch to popup

(cherry picked from commit 73035f276fb7c93f07f65936cc5f3b3613b04874)

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 1 file changed, 1 insertion(+), 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 74dea0c54..a534c4c1f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -596,7 +596,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
     @TargetApi(Build.VERSION_CODES.N)
     public void switchToPopup() {
-        final MediaWrapper mw = mService.getCurrentMediaWrapper();
+        final MediaWrapper mw = mService != null ? mService.getCurrentMediaWrapper() : null;
         if (mw == null)
             return;
         if (AndroidDevices.hasPiP) {



More information about the Android mailing list