progressChapterIndex IndexOutOfBoundsException fix

This commit is contained in:
Finnley Somdahl 2023-12-06 19:34:22 -06:00
parent ac9d3a2363
commit ac6b22f659

View file

@ -203,6 +203,7 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
val chapters = media.manga?.chapters?.values?.toList()
//filter by selected language
val progressChapterIndex = chapters?.indexOfFirst { MangaNameAdapter.findChapterNumber(it.number)?.toInt() == selected }?:0
if (progressChapterIndex < 0 || n < 1) return
val chaptersToDownload = chapters?.subList(
progressChapterIndex + 1,
progressChapterIndex + n + 1