Skip to content

Commit

Permalink
fix: Fix KeyError by no element traveler
Browse files Browse the repository at this point in the history
Fixes HOYO-BUDDY-XR
  • Loading branch information
seriaati committed Jan 10, 2025
1 parent 9d8dfce commit 021a7b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hoyo_buddy/ui/hoyo/characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,11 @@ async def start(self, i: Interaction) -> None:

# Find traveler element and add 1 to the element char count
for character in self.gi_characters:
if character.id in TRAVELER_IDS:
if (
character.id in TRAVELER_IDS
and character.element.lower()
in self.element_char_counts # Prevent KeyError caused by 'None' element traveler
):
self.element_char_counts[character.element.lower()] += 1
break

Expand Down

0 comments on commit 021a7b0

Please sign in to comment.