diff --git a/Libraries/WebSocket/WebSocket.js b/Libraries/WebSocket/WebSocket.js index 5751f0f84..a328aa5b4 100644 --- a/Libraries/WebSocket/WebSocket.js +++ b/Libraries/WebSocket/WebSocket.js @@ -115,7 +115,7 @@ class WebSocket extends WebSocketBase { this.onerror && this.onerror(event); this.dispatchEvent(event); this._unregisterEvents(); - this._closeWebSocket(id); + this.readyState === this.OPEN && this._closeWebSocket(id); }) ]; }