From ccaf00f842fc03de4b23310fdc812fa12346909f Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Thu, 24 Jul 2025 19:00:24 +0300 Subject: [PATCH] Avoid JS errors when stopping go2rtc stream unsuccessfully (MonitorStream.js) --- web/js/MonitorStream.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/js/MonitorStream.js b/web/js/MonitorStream.js index 9a17e56b52..45de21dd76 100644 --- a/web/js/MonitorStream.js +++ b/web/js/MonitorStream.js @@ -466,7 +466,11 @@ function MonitorStream(monitorData) { this.started = false; if (-1 !== this.player.indexOf('go2rtc')) { if (!(stream.wsState === WebSocket.CLOSED && stream.pcState === WebSocket.CLOSED)) { - stream.ondisconnect(); + try { + stream.ondisconnect(); + } catch (e) { + console.warn(e); + } } } else if (-1 !== this.player.indexOf('rtsp2web')) { if (this.webrtc) {