From 924a8189de15fc6662397eb2c62bb0a033efe518 Mon Sep 17 00:00:00 2001 From: Adrian Ulrich Date: Tue, 2 Feb 2016 15:28:38 +0100 Subject: [PATCH] Check for null song + artist, seems to happen on some broken ICS devices --- src/ch/blinkenlights/android/vanilla/RemoteControlImplICS.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ch/blinkenlights/android/vanilla/RemoteControlImplICS.java b/src/ch/blinkenlights/android/vanilla/RemoteControlImplICS.java index 2ad1db08..bc34b477 100644 --- a/src/ch/blinkenlights/android/vanilla/RemoteControlImplICS.java +++ b/src/ch/blinkenlights/android/vanilla/RemoteControlImplICS.java @@ -135,8 +135,7 @@ public class RemoteControlImplICS implements RemoteControl.Client { remote.setPlaybackState(isPlaying ? RemoteControlClient.PLAYSTATE_PLAYING : RemoteControlClient.PLAYSTATE_PAUSED); RemoteControlClient.MetadataEditor editor = remote.editMetadata(true); - if (song != null) { - + if (song != null && song.artist != null && song.album != null) { String artist_album = song.artist + " - " + song.album; artist_album = (song.artist.length() == 0 ? song.album : artist_album); // no artist ? -> only display album artist_album = (song.album.length() == 0 ? song.artist : artist_album); // no album ? -> only display artist