catch error when trying to join ended game
This commit is contained in:
parent
daa211b692
commit
b17dcf5cdc
1 changed files with 7 additions and 2 deletions
|
@ -33,8 +33,13 @@ class GameManager(object):
|
|||
return None
|
||||
if user.id not in self.userid_game or \
|
||||
self.userid_game[user.id] is not game:
|
||||
self.leave_game(user)
|
||||
player = Player(game, user)
|
||||
|
||||
try:
|
||||
self.leave_game(user)
|
||||
player = Player(game, user)
|
||||
except AttributeError:
|
||||
return None
|
||||
|
||||
self.userid_player[user.id] = player
|
||||
self.userid_game[user.id] = game
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue