Skip to content

Commit

Permalink
[Hockey] Fix for a potential keyerror when cleaning up game data
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Mar 27, 2024
1 parent 61b4e2b commit 63fe136
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hockey/hockey.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,12 @@ async def game_check_loop(self) -> None:
for link in self.current_games:
if self.current_games[link]["count"] == 21:
to_delete.append(link)
for link in to_delete:
del self.current_games[link]
del self.saving_goals[link]
try:
for link in to_delete:
del self.current_games[link]
del self.saving_goals[link]
except KeyError:
pass
if not self.api.testing:
await asyncio.sleep(60)
else:
Expand Down

0 comments on commit 63fe136

Please sign in to comment.