Check for null

This commit is contained in:
Martin Fietz 2015-11-01 23:24:55 +01:00
parent f53b181fe8
commit 08a3106f11
1 changed files with 6 additions and 2 deletions

View File

@ -366,10 +366,14 @@ public class PlaybackServiceTaskManager {
}
if (waitingTime <= 0) {
Log.d(TAG, "Sleep timer expired");
shakeListener.pause();
shakeListener = null;
if(shakeListener != null) {
shakeListener.pause();
shakeListener = null;
}
if (!Thread.currentThread().isInterrupted()) {
callback.onSleepTimerExpired();
} else {
Log.d(TAG, "Sleep timer interrupted");
}
}
} catch (InterruptedException e) {