From e464569712506e0bae1a0150898f4c164a3f1cb3 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 8 May 2019 15:37:44 +0200 Subject: [PATCH] Fixed NPE --- .../java/de/danoeh/antennapod/fragment/ItemFragment.java | 2 +- .../antennapod/core/service/playback/PlaybackService.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index e114ef405..4b8f6a16a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -592,7 +592,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { private FeedItem loadInBackground() { FeedItem feedItem = DBReader.getFeedItem(feedItems[feedItemPos]); if (feedItem != null) { - Timeline t = new Timeline(getActivity(), feedItem); + Timeline t = new Timeline(getContext(), feedItem); webviewData = t.processShownotes(false); } return feedItem; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 7fe93a162..29c424e1b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -421,7 +421,10 @@ public class PlaybackService extends MediaBrowserServiceCompat { // Child List try { for (FeedItem feedItem : taskManager.getQueue()) { - mediaItems.add(feedItem.getMedia().getMediaItem()); + FeedMedia media = feedItem.getMedia(); + if (media != null) { + mediaItems.add(media.getMediaItem()); + } } } catch (InterruptedException e) { e.printStackTrace();