mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Fixed crash caused by empty chapter list.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -177,7 +177,7 @@ abstract class CBZ {
|
||||
tags: metaData.tags,
|
||||
comicType: ComicType.local,
|
||||
directory: dest.name,
|
||||
chapters: ComicChapters.fromJson(cpMap),
|
||||
chapters: ComicChapters.fromJsonOrNull(cpMap),
|
||||
downloadedChapters: cpMap?.keys.toList() ?? [],
|
||||
cover: 'cover.${coverFile.extension}',
|
||||
createdAt: DateTime.now(),
|
||||
|
Reference in New Issue
Block a user