diff --git a/genshin/models/zzz/chronicle/stats.py b/genshin/models/zzz/chronicle/stats.py index 24ac9715..14de839f 100644 --- a/genshin/models/zzz/chronicle/stats.py +++ b/genshin/models/zzz/chronicle/stats.py @@ -33,11 +33,13 @@ class ZZZStats(APIModel): shiyu_defense_frontiers: int = Aliased("cur_period_zone_layer_count") bangboo_obtained: int = Aliased("buddy_num") achievement_count: int - hia_coin: HIACoin = Aliased("commemorative_coins_list") + hia_coin: typing.Optional[HIACoin] = Aliased("commemorative_coins_list") @pydantic.field_validator("hia_coin", mode="before") - def __unnest_hia_coin(cls, v: typing.List[typing.Dict[str, typing.Any]]) -> typing.Dict[str, typing.Any]: - return v[0] + def __unnest_hia_coin( + cls, v: typing.List[typing.Dict[str, typing.Any]] + ) -> typing.Optional[typing.Dict[str, typing.Any]]: + return v[0] if v else None class ZZZBaseBangboo(APIModel):