From fa1de0ecc3396bf6d9a49c34e26744db8a0cf2eb Mon Sep 17 00:00:00 2001 From: orz12 Date: Fri, 22 Mar 2024 09:41:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=95=AA=E5=89=A7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/bangumi/info.dart | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/models/bangumi/info.dart b/lib/models/bangumi/info.dart index 025eaafc3..3423d1ee1 100644 --- a/lib/models/bangumi/info.dart +++ b/lib/models/bangumi/info.dart @@ -121,7 +121,9 @@ class BangumiInfoModel { title = json['title']; total = json['total']; type = json['type']; - userStatus = UserStatus.fromJson(json['user_status']); + if (json['user_status'] != null) { + userStatus = UserStatus.fromJson(json['user_status']); + } staff = json['staff']; } } @@ -218,6 +220,7 @@ class EpisodeItem { vid = json['vid']; } } + class UserStatus { UserStatus({ this.areaLimit, @@ -249,11 +252,16 @@ class UserStatus { login = json['login']; pay = json['pay']; payPackPaid = json['pay_pack_paid']; - progress = UserProgress.fromJson(json['progress']); + if (json['progress'] != null) { + progress = UserProgress.fromJson(json['progress']); + } sponsor = json['sponsor']; - vipInfo = VipInfo.fromJson(json['vip_info']); + if (json['vip_info'] != null) { + vipInfo = VipInfo.fromJson(json['vip_info']); + } } } + class UserProgress { UserProgress({ this.lastEpId, @@ -269,6 +277,7 @@ class UserProgress { lastTime = json['last_time']; } } + class VipInfo { VipInfo({ this.dueDate, @@ -283,4 +292,4 @@ class VipInfo { status = json['status']; type = json['type']; } -} \ No newline at end of file +}