diff --git a/lib/utils/ws-requestor.js b/lib/utils/ws-requestor.js index b6883fcb..86884aea 100644 --- a/lib/utils/ws-requestor.js +++ b/lib/utils/ws-requestor.js @@ -109,8 +109,10 @@ class WsRequestor extends BaseRequestor { close() { this.logger.info('WsRequestor: closing socket'); - this.ws && this.ws.close(); - this.ws.removeAllListeners(); + if (this.ws) { + this.ws.close(); + this.ws.removeAllListeners(); + } } _connect() {