Skip to content

Commit

Permalink
fix novel parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed Sep 8, 2024
1 parent 4d043b3 commit bd8960c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/models/novel_web_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NovelWebResponse {
List<dynamic>? glossaryItems;
List<dynamic>? replaceableItemIds;
Map<String, NovelImage>? images;
Map<String, NovelIllusts>? illusts;
Map<String, NovelIllusts?>? illusts;
int? aiType;
bool? isOriginal;
NovelWebResponse({
Expand Down Expand Up @@ -64,7 +64,10 @@ class NovelWebResponse {
illusts: (json['illusts'] is Map<String, dynamic>)
? (json['illusts'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(
k, NovelIllusts.fromJson(e as Map<String, dynamic>)),
k,
(e == null || (e as Map?)?['illust'] == null)
? null
: NovelIllusts.fromJson(e as Map<String, dynamic>)),
)
: null,
images: (json['images'] is Map<String, dynamic>)
Expand Down

0 comments on commit bd8960c

Please sign in to comment.