[Android] VideoPlayer: prevent NPE

Geoffrey Métais git at videolan.org
Mon May 27 16:27:28 CEST 2019


vlc-android | branch: 3.1.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May 27 16:27:00 2019 +0200| [aeec1fa971bde47cc787583e14102b5e1a7865b9] | committer: Geoffrey Métais

VideoPlayer: prevent NPE

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

 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 6a6785aef..30c2dc2cc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2946,7 +2946,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
             mHandler.post(new Runnable() {
                 @Override
                 public void run() { // delay mediaplayer loading, prevent ANR
-                    if (mService.getVolume() > 100 && !audioBoostEnabled) mService.setVolume(100);
+                    if (mService != null && mService.getVolume() > 100 && !audioBoostEnabled) mService.setVolume(100);
                 }
             });
             mService.addCallback(this);



More information about the Android mailing list