Merge pull request #2834 from ByteHamster/npe-remote-psmp

Allow mediaPlayer to be null
This commit is contained in:
Martin Fietz 2018-09-27 13:52:35 +02:00 committed by GitHub
commit c7ec2f26c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -660,7 +660,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
private final PlaybackServiceMediaPlayer.PSMPCallback mediaPlayerCallback = new PlaybackServiceMediaPlayer.PSMPCallback() {
@Override
public void statusChanged(PlaybackServiceMediaPlayer.PSMPInfo newInfo) {
currentMediaType = mediaPlayer.getCurrentMediaType();
if (mediaPlayer != null) {
currentMediaType = mediaPlayer.getCurrentMediaType();
} else {
currentMediaType = MediaType.UNKNOWN;
}
updateMediaSession(newInfo.playerStatus);
switch (newInfo.playerStatus) {
case INITIALIZED: