Skip to content

Commit

Permalink
fix: prevent crash when leaving tournament match channel (#479)
Browse files Browse the repository at this point in the history
* fix: remove non-existence player

* small logic change to avoid unnecessary leave_channel() call

---------

Co-authored-by: cmyui <[email protected]>
  • Loading branch information
KhooHaoYit and cmyui authored Feb 26, 2024
1 parent 6a8bf63 commit f1a1eb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/domains/cho.py
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ async def handle(self, player: Player) -> None:
return # insufficient privs

match = app.state.sessions.matches[self.match_id]
if not match:
if not (match and player.id in match.tourney_clients):
return # match not found

# attempt to join match chan
Expand Down

0 comments on commit f1a1eb2

Please sign in to comment.