Fix crash with no songs on device

This commit is contained in:
Christopher Eby 2010-02-25 23:15:55 -06:00
parent 9530cffaa6
commit 21d5fafa74

View File

@ -468,13 +468,13 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
private void updateNotification()
{
if (!mNotifyWhilePaused && mState == STATE_NORMAL) {
Song song = getSong(0);
if (song == null || !mNotifyWhilePaused && mState == STATE_NORMAL) {
mNotificationManager.cancel(NOTIFICATION_ID);
return;
}
Song song = getSong(0);
String title = song.title;
if (mState != STATE_PLAYING)
title += ' ' + getResources().getString(R.string.paused);