[Android] Prevent NPE in playbackservice
Geoffrey Métais
git at videolan.org
Wed Nov 22 16:08:11 CET 2017
vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 22 14:57:43 2017 +0100| [3af4252530fe4810343f5f7e989c83a44938bb6a] | committer: Geoffrey Métais
Prevent NPE in playbackservice
(cherry picked from commit 8e97e1cc7eb6ff345a472fdd9940bf390ee83302)
> https://code.videolan.org/videolan/vlc-android/commit/3af4252530fe4810343f5f7e989c83a44938bb6a
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 9742ea2bb..bb6a7841a 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -986,7 +986,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
while (ExecutorHolder.updateMeta.get())
ExecutorHolder.updateMeta.wait();
} catch (InterruptedException ignored) {}
- final MediaMetadataCompat metaData = mMediaSession.getController().getMetadata();
+ final MediaMetadataCompat metaData = mMediaSession != null ? mMediaSession.getController().getMetadata() : null;
title = metaData == null ? mw.getTitle() : metaData.getString(MediaMetadataCompat.METADATA_KEY_TITLE);
artist = metaData == null ? mw.getArtist() : metaData.getString(MediaMetadataCompat.METADATA_KEY_ALBUM_ARTIST);
album = metaData == null ? mw.getAlbum() : metaData.getString(MediaMetadataCompat.METADATA_KEY_ALBUM);
More information about the Android
mailing list