Browse Source

Guard uses of the keep alive thread in case they're None

Fixes #5800
pull/5810/head
Rapptz 5 years ago
parent
commit
f8808dba9b
  1. 2
      discord/gateway.py

2
discord/gateway.py

@ -398,10 +398,12 @@ class DiscordWebSocket:
raise ReconnectWebSocket(self.shard_id) raise ReconnectWebSocket(self.shard_id)
if op == self.HEARTBEAT_ACK: if op == self.HEARTBEAT_ACK:
if self._keep_alive:
self._keep_alive.ack() self._keep_alive.ack()
return return
if op == self.HEARTBEAT: if op == self.HEARTBEAT:
if self._keep_alive:
beat = self._keep_alive.get_payload() beat = self._keep_alive.get_payload()
await self.send_as_json(beat) await self.send_as_json(beat)
return return

Loading…
Cancel
Save