Skip to content

Commit

Permalink
Don't crash trying to show item at negative position (#6407)
Browse files Browse the repository at this point in the history
I have no idea what code path could pass a negative number there,
but apparently there are users who experience a crash when trying
to show a negative position.
  • Loading branch information
ByteHamster committed Apr 2, 2023
1 parent 78f6534 commit b706ab9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static ItemPagerFragment newInstance(long[] feeditems, int feedItemPos) {
ItemPagerFragment fragment = new ItemPagerFragment();
Bundle args = new Bundle();
args.putLongArray(ARG_FEEDITEMS, feeditems);
args.putInt(ARG_FEEDITEM_POS, feedItemPos);
args.putInt(ARG_FEEDITEM_POS, Math.max(0, feedItemPos));
fragment.setArguments(args);
return fragment;
}
Expand Down

0 comments on commit b706ab9

Please sign in to comment.