diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-04-06 20:00:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 20:00:17 +0200 |
commit | 596bdaed3fe4d5aa0c90ba5a8f21f0bf4e719ef2 (patch) | |
tree | eb422d434435407cb946a991c1bbc4e2ce61fced /core | |
parent | 9b989fed432b1c9b82d7a30429f12523e3f6b145 (diff) | |
download | AntennaPod-596bdaed3fe4d5aa0c90ba5a8f21f0bf4e719ef2.zip |
Don't crash when Chromecast media is not loaded yet (#6417)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 6 |
1 files changed, 4 insertions, 2 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 43ee32680..f207339bc 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 @@ -767,8 +767,10 @@ public class PlaybackService extends MediaBrowserServiceCompat { updateMediaSession(newInfo.playerStatus); switch (newInfo.playerStatus) { case INITIALIZED: - PlaybackPreferences.writeMediaPlaying(mediaPlayer.getPSMPInfo().playable, - mediaPlayer.getPSMPInfo().playerStatus); + if (mediaPlayer.getPSMPInfo().playable != null) { + PlaybackPreferences.writeMediaPlaying(mediaPlayer.getPSMPInfo().playable, + mediaPlayer.getPSMPInfo().playerStatus); + } updateNotificationAndMediaSession(newInfo.playable); break; case PREPARED: |