Fixed crash caused by empty chapter list.

This commit is contained in:
2025-02-23 20:24:43 +08:00
parent 587c5d8040
commit fd19f6bf7d
2 changed files with 4 additions and 2 deletions

View File

@@ -336,8 +336,10 @@ class ComicChapters {
}
if (chapters.isNotEmpty) {
return ComicChapters(chapters);
} else {
} else if (groupedChapters.isNotEmpty) {
return ComicChapters.grouped(groupedChapters);
} else {
throw ArgumentError("Empty chapter list");
}
}