Skip to content

Commit 52e4469

Browse files
committed
Fix ValueError: list.remove(x): x not in list
1 parent ec5702e commit 52e4469

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

server/game.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,11 @@ def update_in_plays(self) -> None:
939939
self.wplayer.game_in_progress = None
940940

941941
if self.corr:
942-
self.wplayer.correspondence_games.remove(self)
943-
self.bplayer.correspondence_games.remove(self)
942+
try:
943+
self.wplayer.correspondence_games.remove(self)
944+
self.bplayer.correspondence_games.remove(self)
945+
except ValueError:
946+
pass
944947

945948
def print_game(self) -> None:
946949
print(self.pgn)

0 commit comments

Comments
 (0)