[Android] Check mediasession is not null

Geoffrey Métais git at videolan.org
Thu Nov 9 17:19:45 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Nov  9 17:02:34 2017 +0100| [9b3e279997f06e2e36c20ee04ed68cf606c72173] | committer: Geoffrey Métais

Check mediasession is not null

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 7e1952db1..bb9de1f3e 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1413,7 +1413,8 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
                 VLCApplication.runOnMainThread(new Runnable() {
                     @Override
                     public void run() {
-                        mMediaSession.setMetadata(bob.build());
+                        if (mMediaSession != null)
+                            mMediaSession.setMetadata(bob.build());
                         synchronized (ExecutorHolder.updateMeta) {
                             ExecutorHolder.updateMeta.set(false);
                             ExecutorHolder.updateMeta.notify();



More information about the Android mailing list