mirror of https://gitlab.com/litecord/litecord.git
gateway: do not dispatch raw events when state isn't set
this is possible if a connection quickly disconnects while connecting close #136
This commit is contained in:
parent
17e851e95f
commit
5bd292422b
|
|
@ -397,6 +397,12 @@ class GatewayWebsocket:
|
|||
such as READY and RESUMED, or events that are replies to
|
||||
messages in the websocket.
|
||||
"""
|
||||
if not self.state:
|
||||
log.warning(
|
||||
"can not dispatch {!r} as there is no state in ws {!r}", event, self
|
||||
)
|
||||
return
|
||||
|
||||
payload = {
|
||||
"op": OP.DISPATCH,
|
||||
"t": event.upper(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue