2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/20992 - Speculative fix for TopSitesPagerAdapter crash

This commit is contained in:
codrut.topliceanu 2021-10-07 10:48:42 +03:00 committed by mergify[bot]
parent 6f7d91efb1
commit 822775eb9d

View File

@ -59,7 +59,10 @@ class TopSitesPagerAdapter(
// Update new list with the changed items
currentPageChangedItems.forEach { item ->
refreshedItems[item.first - (position * TOP_SITES_PER_PAGE)] = item.second
val index = item.first - (position * TOP_SITES_PER_PAGE)
if (index in refreshedItems.indices) {
refreshedItems[index] = item.second
}
}
// Display the updated list without any of the removed items