Skip to content

Commit

Permalink
stop disconnect error if socket is not null, but closed
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisrijsdijk committed Feb 28, 2024
1 parent ca357c1 commit 9dd58fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/integration.ts
Expand Up @@ -98,7 +98,7 @@ class HypeRateIntegration extends EventEmitter {
}

disconnect() {
if (this._socket == null) {
if (this._socket == null || this._socket.readyState === WebSocket.CLOSED) {
return;
}
this._socket.close(3000, "Purposeful Disconnect");
Expand Down

0 comments on commit 9dd58fa

Please sign in to comment.