mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-18 22:14:23 +01:00
relay: only send if socket is open
This commit is contained in:
@@ -90,7 +90,9 @@ function connectStream(socket: WebSocket) {
|
||||
|
||||
/** Send a message back to the client. */
|
||||
function send(msg: RelayMsg): void {
|
||||
return socket.send(JSON.stringify(msg));
|
||||
if (socket.readyState === WebSocket.OPEN) {
|
||||
socket.send(JSON.stringify(msg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user