Skip to content

Commit

Permalink
fix(WebSocketShard): only cleanup the connection if a connection stil…
Browse files Browse the repository at this point in the history
…l exists (#8946)

fix(WebSocketShard): only cleanup if connection
  • Loading branch information
Qjuh committed Dec 18, 2022
1 parent 0cf29ab commit 5eab5fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/discord.js/src/client/websocket/WebSocketShard.js
Expand Up @@ -603,7 +603,9 @@ class WebSocketShard extends EventEmitter {
);

// Cleanup connection listeners
this._cleanupConnection();
if (this.connection) {
this._cleanupConnection();
}

this.emitClose();
// Setting the variable false to check for zombie connections.
Expand Down

0 comments on commit 5eab5fc

Please sign in to comment.