Fix IndexOutOfBoundsException when using Split tall images (#7892)

Also little cleanup
This commit is contained in:
AntsyLich
2022-08-29 23:02:34 +06:00
committed by GitHub
parent 0e526c36be
commit b79340989f
2 changed files with 10 additions and 12 deletions

View File

@@ -32,7 +32,7 @@ class WebtoonAdapter(val viewer: WebtoonViewer) : RecyclerView.Adapter<RecyclerV
val placeAtIndex = items.indexOf(currentStrip) + 1
// Stop constantly adding split images
if (items[placeAtIndex] is StencilPage) return
if (items.getOrNull(placeAtIndex) is StencilPage) return
val updatedItems = items.toMutableList()
updatedItems.addAll(placeAtIndex, newStrips)