diff options
author | Herbert Reiter <46045854+damoasda@users.noreply.github.com> | 2020-08-02 22:43:47 +0200 |
---|---|---|
committer | Herbert Reiter <46045854+damoasda@users.noreply.github.com> | 2020-08-03 21:43:19 +0200 |
commit | 46b886baa3aaa79a78b16fd63c4227eafc212ff3 (patch) | |
tree | ac602cc29c17ab0e4f3ef501f59e06492bb4e4dc /app | |
parent | de70873e96d3fb727fd74fce7009c4cd05aefa98 (diff) | |
download | AntennaPod-46b886baa3aaa79a78b16fd63c4227eafc212ff3.zip |
Fix NullPointerException in FeedItemlistFragment when deleting a podcast
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index b90da7447..67433166c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -358,7 +358,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem if (event.hasChangedFeedUpdateStatus(isUpdatingFeed)) { updateSyncProgressBarVisibility(); } - if (adapter != null && update.mediaIds.length > 0) { + if (adapter != null && update.mediaIds.length > 0 && feed != null) { for (long mediaId : update.mediaIds) { int pos = FeedItemUtil.indexOfItemWithMediaId(feed.getItems(), mediaId); if (pos >= 0) { @@ -398,7 +398,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem @Subscribe(threadMode = ThreadMode.MAIN) public void onFeedListChanged(FeedListUpdateEvent event) { - if (event.contains(feed)) { + if (feed != null && event.contains(feed)) { updateUi(); } } @@ -425,7 +425,9 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem } recyclerView.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); - adapter.updateItems(feed.getItems()); + if (feed != null) { + adapter.updateItems(feed.getItems()); + } getActivity().supportInvalidateOptionsMenu(); updateSyncProgressBarVisibility(); @@ -553,4 +555,4 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem holder.coverHolder.setVisibility(View.GONE); } } -} +}
\ No newline at end of file |