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.
This commit is contained in:
parent
f1f3674230
commit
fa12968ae5
|
@ -70,7 +70,7 @@ public class ItemPagerFragment extends Fragment implements MaterialToolbar.OnMen
|
||||||
toolbar.setOnMenuItemClickListener(this);
|
toolbar.setOnMenuItemClickListener(this);
|
||||||
|
|
||||||
feedItems = getArguments().getLongArray(ARG_FEEDITEMS);
|
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);
|
pager = layout.findViewById(R.id.pager);
|
||||||
// FragmentStatePagerAdapter documentation:
|
// FragmentStatePagerAdapter documentation:
|
||||||
|
|
Loading…
Reference in New Issue