From 19d7e6fecd7e88da341abe2a2579f8dc930f5ccf Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Mon, 23 Jan 2023 05:28:08 +0100 Subject: [PATCH] prevent channel from opening if connection is closed --- public/scripts/network.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/scripts/network.js b/public/scripts/network.js index 6ccbf17..4554f62 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -518,6 +518,7 @@ class RTCPeer extends Peer { } _openChannel() { + if (this._conn.signalingState === "closed") return; const channel = this._conn.createDataChannel('data-channel', { ordered: true, reliable: true // Obsolete. See https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable