summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorMartin Fietz <Martin.Fietz@gmail.com>2018-11-11 10:06:22 +0100
committerGitHub <noreply@github.com>2018-11-11 10:06:22 +0100
commit816eb99e367ee6da9849b874cd0ff5c60cdd37ec (patch)
tree6efce7cda616cde77b12c5629be3b90999d62125 /core/src
parent49b70124310249475d76eb1472141a0c2e68e742 (diff)
parent3ee412a560a9ede3cb3e2e6042af6fc8dbf1fe6a (diff)
downloadAntennaPod-816eb99e367ee6da9849b874cd0ff5c60cdd37ec.zip
Merge pull request #2889 from AntennaPod/2882
Prevent NPE
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
index 041f1a809..68c9ac0ce 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
@@ -1096,7 +1096,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
} else {
state = PlaybackStateCompat.STATE_NONE;
}
- sessionState.setState(state, mediaPlayer.getPosition(), mediaPlayer.getPlaybackSpeed());
+ sessionState.setState(state, getCurrentPosition(), getCurrentPlaybackSpeed());
long capabilities = PlaybackStateCompat.ACTION_PLAY_PAUSE
| PlaybackStateCompat.ACTION_REWIND
| PlaybackStateCompat.ACTION_FAST_FORWARD
@@ -1636,6 +1636,9 @@ public class PlaybackService extends MediaBrowserServiceCompat {
}
public float getCurrentPlaybackSpeed() {
+ if(mediaPlayer == null) {
+ return 1.0f;
+ }
return mediaPlayer.getPlaybackSpeed();
}