diff --git a/src/org/kreed/vanilla/PlaybackService.java b/src/org/kreed/vanilla/PlaybackService.java index c48cde13..eddf935d 100644 --- a/src/org/kreed/vanilla/PlaybackService.java +++ b/src/org/kreed/vanilla/PlaybackService.java @@ -445,12 +445,12 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On return false; Song song = getSong(0); + if (song == null && state == STATE_PLAYING) + return false; + int oldState = mState; mState = state; - if (song == null) - return false; - broadcastChange(oldState, state, song); boolean cancelNotification; @@ -499,7 +499,8 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On private boolean updateNotification(Song song) { if (song == null || !mNotifyWhilePaused && mState == STATE_NORMAL) { - mNotificationManager.cancel(NOTIFICATION_ID); + if (mNotificationManager != null) + mNotificationManager.cancel(NOTIFICATION_ID); return true; }