diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/LocalPSMP.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/LocalPSMP.java index e6f2668e6..c1d55c8e8 100644 --- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/LocalPSMP.java +++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/LocalPSMP.java @@ -31,6 +31,7 @@ import org.greenrobot.eventbus.EventBus; import java.io.File; import java.io.IOException; +import java.util.Collections; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -579,6 +580,9 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { } public List getAudioTracks() { + if (mediaPlayer == null) { + return Collections.emptyList(); + } return mediaPlayer.getAudioTracks(); } @@ -587,6 +591,9 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { } public int getSelectedAudioTrack() { + if (mediaPlayer == null) { + return -1; + } return mediaPlayer.getSelectedAudioTrack(); }