Skip to content

Commit

Permalink
Check null
Browse files Browse the repository at this point in the history
  • Loading branch information
up2code committed Oct 13, 2019
1 parent 267b78e commit d20cc92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/models/artist_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lib/models/entry_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lib/models/main_picture_model.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:collection';

class MainPictureModel {
String meme;
String urlSmallThumb;
Expand Down

0 comments on commit d20cc92

Please sign in to comment.