out of bounds on 25 fix

This commit is contained in:
Finnley Somdahl 2023-12-06 19:21:53 -06:00
parent 876304065d
commit ac98417355

View file

@ -120,6 +120,7 @@ class MangaChapterAdapter(
fun downloadNChaptersFrom(position: Int, n: Int) { fun downloadNChaptersFrom(position: Int, n: Int) {
//download next n chapters //download next n chapters
if (position < 0 || position >= arr.size) return
for (i in 0..<n) { for (i in 0..<n) {
if (position + i < arr.size) { if (position + i < arr.size) {
val chapterNumber = arr[position + i].number val chapterNumber = arr[position + i].number