diff options
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/ui/screen/chapter/ChaptersFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/ui/screen/playback/audio/CoverFragment.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/chapter/ChaptersFragment.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/chapter/ChaptersFragment.java index 8fea6e209..45838d845 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/screen/chapter/ChaptersFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/chapter/ChaptersFragment.java @@ -127,7 +127,7 @@ public class ChaptersFragment extends AppCompatDialogFragment { } private int getCurrentChapter(Playable media) { - if (controller == null) { + if (controller == null || media == null) { return -1; } return Chapter.getAfterPosition(media.getChapters(), controller.getPosition()); diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/playback/audio/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/playback/audio/CoverFragment.java index 57794b410..073d5b0be 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/screen/playback/audio/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/playback/audio/CoverFragment.java @@ -261,6 +261,9 @@ public class CoverFragment extends Fragment { @Subscribe(threadMode = ThreadMode.MAIN) public void onEventMainThread(PlaybackPositionEvent event) { + if (media == null) { + return; + } int newChapterIndex = Chapter.getAfterPosition(media.getChapters(), event.getPosition()); if (newChapterIndex > -1 && newChapterIndex != displayedChapterIndex) { refreshChapterData(newChapterIndex); |