From d1fca86636ba8b990e9055d4825f20f062619f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 12 May 2022 10:58:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Better=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/static/js/app/viewmodels/control.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/octoprint/static/js/app/viewmodels/control.js b/src/octoprint/static/js/app/viewmodels/control.js index 38431100e..52a036e36 100644 --- a/src/octoprint/static/js/app/viewmodels/control.js +++ b/src/octoprint/static/js/app/viewmodels/control.js @@ -573,7 +573,13 @@ $(function () { } // Determine stream type and switch to corresponding webcam. - var streamType = determineWebcamStreamType(self.settings.webcam_streamUrl()); + var streamType; + try { + streamType = determineWebcamStreamType(self.settings.webcam_streamUrl()); + } catch (e) { + streamType = ""; + } + if (streamType == "mjpg") { self._switchToMjpgWebcam(); } else if (streamType == "hls") {