Skip to content

Commit b232daf

Browse files
Merge pull request #4384 from IgorA100/patch-14341
Fix: Avoid JS errors when stopping go2rtc stream unsuccessfully (MonitorStream.js)
2 parents 25ffe38 + ccaf00f commit b232daf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

web/js/MonitorStream.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,11 @@ function MonitorStream(monitorData) {
466466
this.started = false;
467467
if (-1 !== this.player.indexOf('go2rtc')) {
468468
if (!(stream.wsState === WebSocket.CLOSED && stream.pcState === WebSocket.CLOSED)) {
469-
stream.ondisconnect();
469+
try {
470+
stream.ondisconnect();
471+
} catch (e) {
472+
console.warn(e);
473+
}
470474
}
471475
} else if (-1 !== this.player.indexOf('rtsp2web')) {
472476
if (this.webrtc) {

0 commit comments

Comments
 (0)