Don't crash when Chromecast media is not loaded yet (#6417)

This commit is contained in:
ByteHamster 2023-04-06 20:00:17 +02:00 committed by GitHub
parent 9b989fed43
commit 596bdaed3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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: