From 277a33321a20909541b46bf4ecf794fd47e19fb1 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 24 Jun 2024 20:59:56 +0800 Subject: [PATCH] :bug: Fix empty data in starrail challenge boss floor --- simnet/models/starrail/chronicle/challenge_boss.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/simnet/models/starrail/chronicle/challenge_boss.py b/simnet/models/starrail/chronicle/challenge_boss.py index 53fc3be..30a6ecd 100644 --- a/simnet/models/starrail/chronicle/challenge_boss.py +++ b/simnet/models/starrail/chronicle/challenge_boss.py @@ -51,12 +51,17 @@ class StarRailChallengeBossBuff(APIModel): class StarRailChallengeBossFloorNode(APIModel): """Node for a floor.""" - challenge_time: PartialTime + challenge_time: Optional[PartialTime] = None avatars: List[RogueCharacter] buff: Optional[StarRailChallengeBossBuff] = None score: int boss_defeated: bool + @property + def has_data(self) -> bool: + """Check if the node has data.""" + return bool(self.avatars) + class StarRailChallengeBossFloor(APIModel): """Floor in a challenge."""