Merge pull request #296 from slikie/patch-1

Fix program crash when switching accounts due to empty unhandled WS message #1
This commit is contained in:
trigg 2023-04-22 12:37:18 +01:00 committed by GitHub
commit f7058f7171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -757,7 +757,7 @@ class DiscordConnector:
# Connection was closed in the meantime
return True
recv, _w, _e = select.select((self.websocket.sock,), (), (), 0)
except websocket.WebSocketConnectionClosedException:
except (websocket.WebSocketConnectionClosedException, json.decoder.JSONDecodeError):
self.on_close()
return True
return True