Skip to content

Commit

Permalink
refactor: Refactor HSR card draw func for easier character id change
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Oct 23, 2024
1 parent 4680d91 commit 426dffe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hoyo_buddy/ui/hoyo/profile/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ async def _draw_hb_hsr_character_card(
) -> BytesIO:
"""Draw Star Rail character card in Hoyo Buddy template."""
assert isinstance(character, enka.hsr.Character | HoyolabHSRCharacter)
character_data = self._card_data.get(str(character.id))

character_id = str(character.id)
character_data = self._card_data.get(character_id)
if character_data is None:
raise CardNotReadyError(character.name)

Expand Down

0 comments on commit 426dffe

Please sign in to comment.