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) {