[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Tue Feb 17 17:43:48 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 17 15:58:58 2015 +0100| [a44c24ca898acdaec8e7337ac779bb09eba59b41] | committer: Geoffrey Métais

Prevent NPE

CID #1270655

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=a44c24ca898acdaec8e7337ac779bb09eba59b41
---

 vlc-android/src/org/videolan/vlc/audio/AudioService.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/audio/AudioService.java b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
index b0dd3a5..d427ed3 100644
--- a/vlc-android/src/org/videolan/vlc/audio/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
@@ -942,7 +942,7 @@ public class AudioService extends Service {
         }
 
         //Send metadata to Pebble watch
-        if (mPebbleEnabled) {
+        if (media != null && mPebbleEnabled) {
             final Intent i = new Intent("com.getpebble.action.NOW_PLAYING");
             i.putExtra("artist", Util.getMediaArtist(this, media));
             i.putExtra("album", Util.getMediaAlbum(this, media));



More information about the Android mailing list