only reopen connection if it exists

This commit is contained in:
schlagmichdoch 2023-01-06 15:49:30 +01:00
parent 7b84154e3f
commit 8b8c887458

View file

@ -309,7 +309,7 @@ class RTCPeer extends Peer {
_onChannelClosed() {
console.log('RTC: channel closed', this._peerId);
if (!this._isCaller) return;
if (!this._isCaller || !this._conn) return;
this._connect(this._peerId, true); // reopen the channel
}