fix: ws handle possible timeout

This commit is contained in:
tiagosiebler
2020-10-05 21:15:10 +01:00
parent 0717a122c1
commit af6a6e647b

View File

@@ -62,7 +62,7 @@ module.exports = class WebsocketClient extends EventEmitter {
this.logger.info('Closing connection', {category: 'bybit-ws'});
this.readyState = READY_STATE_CLOSING;
this._teardown();
this.ws.close();
this.ws && this.ws.close();
}
async _connect() {