Some crash fixes

This commit is contained in:
arkon
2020-12-13 10:58:24 -05:00
parent 91fa1ec6b2
commit fd2028557e
8 changed files with 12 additions and 15 deletions
@@ -923,7 +923,7 @@ class MangaController :
private fun markPreviousAsRead(chapters: List<ChapterItem>) {
val adapter = chaptersAdapter ?: return
val prevChapters = if (presenter.sortDescending()) adapter.items.reversed() else adapter.items
val chapterPos = prevChapters.indexOf(chapters.last())
val chapterPos = prevChapters.indexOf(chapters.lastOrNull())
if (chapterPos != -1) {
markAsRead(prevChapters.take(chapterPos))
}