[Android] VideoPlayer: prevent NPE

Geoffrey Métais git at videolan.org
Mon Dec 17 11:11:12 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec 17 10:28:50 2018 +0100| [043449dec1eb15545b696194b7d3f3f71d841093] | committer: Geoffrey Métais

VideoPlayer: prevent NPE

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

 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 c8c43f10b..d97f9e983 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -772,7 +772,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
         /* Stop listening for changes to media routes. */
         if (!mIsBenchmark) mDisplayManager.removeMediaRouterCallback();
 
-        if (!mDisplayManager.isSecondary()) mService.getMediaplayer().detachViews();
+        if (!mDisplayManager.isSecondary() && mService != null) mService.getMediaplayer().detachViews();
 
         mActionBarView.setOnTouchListener(null);
     }



More information about the Android mailing list