[Android] Check mediasession is not null

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


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

Check mediasession is not null

(cherry picked from commit 9b3e279997f06e2e36c20ee04ed68cf606c72173)

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

 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 89a035af6..298972d51 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1406,7 +1406,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