summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-07-15 22:04:11 +0200
committerGitHub <noreply@github.com>2023-07-15 22:04:11 +0200
commitfa12968ae55385d277b80b27140daec0607f6d07 (patch)
treef0c5fa15b9f5777ea717fcb5467d5267d96350b2
parentf1f36742309a2aebd0aab0d5c7d3016dfe23ec0c (diff)
downloadAntennaPod-fa12968ae55385d277b80b27140daec0607f6d07.zip
Fix crash in item pager (#6542)
There should be no code path for feedItemPos to still be -1, but the crash reports indicate that it does. So this is now the dirty fix to avoid app crashes.
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java
index f2cd02cec..016f29e65 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java
@@ -70,7 +70,7 @@ public class ItemPagerFragment extends Fragment implements MaterialToolbar.OnMen
toolbar.setOnMenuItemClickListener(this);
feedItems = getArguments().getLongArray(ARG_FEEDITEMS);
- int feedItemPos = getArguments().getInt(ARG_FEEDITEM_POS);
+ final int feedItemPos = Math.max(0, getArguments().getInt(ARG_FEEDITEM_POS));
pager = layout.findViewById(R.id.pager);
// FragmentStatePagerAdapter documentation: