Skip to content

Commit

Permalink
fix: ws handle possible timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Oct 5, 2020
1 parent 0717a12 commit af6a6e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/websocket-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit af6a6e6

Please sign in to comment.