fix: 处理边界条件

This commit is contained in:
手瓜一十雪 2024-08-13 00:48:51 +08:00
parent a78def3d2d
commit fcd620283f

View File

@ -26,7 +26,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
}
onEvent<T extends OB11EmitEventContent>(event: T) {
if (this.connection) {
if (this.connection && this.connection.readyState === WebSocket.OPEN) {
this.connection.send(JSON.stringify(event));
}
}