diff --git a/lib/models/artist_model.dart b/lib/models/artist_model.dart index 44f3d623..135e477d 100644 --- a/lib/models/artist_model.dart +++ b/lib/models/artist_model.dart @@ -21,7 +21,7 @@ class ArtistModel extends EntryModel { description = json['description'], releaseDate = json['releaseDate'], relations = (json.containsKey('relations')) - ? ArtistRelations.fromJson(json['relations']) + ? ArtistRelations.fromJson(json['relations'] ?? {}) : null, baseVoicebank = (json.containsKey('baseVoicebank') && !(json['baseVoicebank'] is int)) diff --git a/lib/models/entry_model.dart b/lib/models/entry_model.dart index b626a4dc..35b16517 100644 --- a/lib/models/entry_model.dart +++ b/lib/models/entry_model.dart @@ -36,7 +36,7 @@ class EntryModel extends BaseModel { artistString = json['artistString'], artistType = json['artistType'], mainPicture = json.containsKey('mainPicture') - ? MainPictureModel.fromJson(json['mainPicture']) + ? MainPictureModel.fromJson(json['mainPicture'] ?? {}) : null, tagGroups = (json.containsKey('tags')) ? (json['tags'] as List) diff --git a/lib/models/main_picture_model.dart b/lib/models/main_picture_model.dart index 57721223..dafa2228 100644 --- a/lib/models/main_picture_model.dart +++ b/lib/models/main_picture_model.dart @@ -1,3 +1,5 @@ +import 'dart:collection'; + class MainPictureModel { String meme; String urlSmallThumb;