Merge pull request #3729 from ByteHamster/try-fix-crash

Try to fix ArrayIndexOutOfBoundsException
This commit is contained in:
H. Lehmann 2020-01-05 00:45:34 +01:00 committed by GitHub
commit 71d281a818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -245,8 +245,9 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
public void onClick(View v) {
MainActivity mainActivity = mainActivityRef.get();
if (mainActivity != null) {
long[] ids = itemAccess.getItemsIds().toArray();
mainActivity.loadChildFragment(ItemPagerFragment.newInstance(ids, getAdapterPosition()));
LongList itemIds = itemAccess.getItemsIds();
long[] ids = itemIds.toArray();
mainActivity.loadChildFragment(ItemPagerFragment.newInstance(ids, itemIds.indexOf(item.getId())));
}
}