fix(Client): safe call for possibly null WebSocket (#9600)

fix(client): safe call for possibly null Websocket
This commit is contained in:
nopeless
2023-05-27 02:27:17 +09:00
committed by GitHub
parent e1b6eeed0e
commit 24a61495b9

View File

@@ -325,7 +325,7 @@ class WebSocketManager extends EventEmitter {
// TODO: Make a util for getting a stack
this.debug(`Manager was destroyed. Called by:\n${new Error().stack}`);
this.destroyed = true;
this._ws.destroy({ code: CloseCodes.Normal });
this._ws?.destroy({ code: CloseCodes.Normal });
}
/**