Merge pull request #20009 from prlanzarin/u27/fix/onconnectionstatechange-crash-rc
[2.7] fix(bbb-html5): crash when stopping WebRTC peers
This commit is contained in:
commit
711487c2c9
@ -283,7 +283,9 @@ class BaseBroker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (connectionState === 'failed' || connectionState === 'closed') {
|
if (connectionState === 'failed' || connectionState === 'closed') {
|
||||||
this.webRtcPeer.peerConnection.onconnectionstatechange = null;
|
if (this.webRtcPeer?.peerConnection) {
|
||||||
|
this.webRtcPeer.peerConnection.onconnectionstatechange = null;
|
||||||
|
}
|
||||||
// 1307: "ICE_STATE_FAILED",
|
// 1307: "ICE_STATE_FAILED",
|
||||||
const error = BaseBroker.assembleError(1307);
|
const error = BaseBroker.assembleError(1307);
|
||||||
this.onerror(error);
|
this.onerror(error);
|
||||||
@ -343,7 +345,7 @@ class BaseBroker {
|
|||||||
this.onerror = function(){};
|
this.onerror = function(){};
|
||||||
window.removeEventListener('beforeunload', this.onbeforeunload);
|
window.removeEventListener('beforeunload', this.onbeforeunload);
|
||||||
|
|
||||||
if (this.webRtcPeer) {
|
if (this.webRtcPeer?.peerConnection) {
|
||||||
this.webRtcPeer.peerConnection.onconnectionstatechange = null;
|
this.webRtcPeer.peerConnection.onconnectionstatechange = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user