diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/model/HistoryInfo.kt b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/model/HistoryInfo.kt index e59f7f712..a87a32b97 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/model/HistoryInfo.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/model/HistoryInfo.kt @@ -31,7 +31,11 @@ fun HistoryInfo( history: MangaHistory?, isIncognitoMode: Boolean ): HistoryInfo { - val chapters = manga?.chapters?.get(branch) + val chapters = if (manga?.chapters?.isEmpty() == true) { + emptyList() + } else { + manga?.chapters?.get(branch) + } val currentChapter = if (history != null && !chapters.isNullOrEmpty()) { chapters.indexOfFirst { it.id == history.chapterId } } else {