double error and crash fix

This commit is contained in:
Finnley Somdahl 2023-11-05 02:40:40 -06:00
parent 5a482d8307
commit cd3aad1c33
2 changed files with 5 additions and 1 deletions

View file

@ -215,6 +215,10 @@ class MangaReaderActivity : AppCompatActivity() {
logError(e)
}
}
//check that index is not out of bounds (crash fix)
if (media.selected!!.sourceIndex >= model.mangaReadSources!!.names.size) {
media.selected!!.sourceIndex = 0
}
binding.mangaReaderSource.text = model.mangaReadSources!!.names[media.selected!!.sourceIndex]
binding.mangaReaderTitle.text = media.userPreferredName