From f947b0a90dcfc338e8557bcec90e97082cb0a7de Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 13 Apr 2019 16:01:17 +0200 Subject: [PATCH] Fixed NPE --- .../danoeh/antennapod/fragment/ExternalPlayerFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 508659f65..d26725436 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -145,6 +145,7 @@ public class ExternalPlayerFragment extends Fragment { super.onStart(); controller = setupPlaybackController(); controller.init(); + loadMediaInfo(); EventBus.getDefault().register(this); } @@ -250,7 +251,9 @@ public class ExternalPlayerFragment extends Fragment { } private void onPositionObserverUpdate() { - if (controller.getPosition() == PlaybackService.INVALID_TIME + if (controller == null) { + return; + } else if (controller.getPosition() == PlaybackService.INVALID_TIME || controller.getDuration() == PlaybackService.INVALID_TIME) { return; }