Check for null song + artist, seems to happen on some broken ICS devices

This commit is contained in:
Adrian Ulrich 2016-02-02 15:28:38 +01:00
parent 5ca50aeebe
commit 924a8189de

View File

@ -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