Skip to content

Commit

Permalink
Handle a very rare assert correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Torom committed Jun 24, 2024
1 parent 3580924 commit 3b758d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion matchmaking.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def create_challenge(self, pending_challenge: Pending_Challenge) -> None:
if response.challenge_id:
pending_challenge.set_challenge_id(response.challenge_id)

assert last_response
if last_response is None:
pending_challenge.return_early()
return

if not last_response.success and not (last_response.has_reached_rate_limit or last_response.is_misconfigured):
self.opponents.add_timeout(False, self.current_type.estimated_game_duration, self.current_type)

Expand Down

0 comments on commit 3b758d5

Please sign in to comment.