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

pull/600/head
codrut.topliceanu 3 years ago committed by mergify[bot]
parent 6f7d91efb1
commit 822775eb9d

@ -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

Loading…
Cancel
Save