fix common list exception

This commit is contained in:
niuhuan 2021-10-25 10:36:05 +08:00
parent ca956ccb4c
commit 78db409055
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ class BasicUser {
this.verified = json["verified"];
this.exp = json["exp"];
this.level = json["level"];
this.characters = List.of(json["characters"]).map((e) => "$e").toList();
this.characters = json["characters"] == null
? []
: List.of(json["characters"]).map((e) => "$e").toList();
this.avatar = PicaImage.fromJson(Map<String, dynamic>.of(json["avatar"]));
}
}