From 78db409055a66a7debfcf949e770ac6f576bcaa6 Mon Sep 17 00:00:00 2001 From: niuhuan Date: Mon, 25 Oct 2021 10:36:05 +0800 Subject: [PATCH] fix common list exception --- lib/basic/Entities.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/basic/Entities.dart b/lib/basic/Entities.dart index 1011e15..66634ee 100644 --- a/lib/basic/Entities.dart +++ b/lib/basic/Entities.dart @@ -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.of(json["avatar"])); } }