From 6620236bc351b51d2ab36fa8a7f783aaad706bc0 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 18 Jan 2023 16:20:44 -0700 Subject: [PATCH] Catch case where go2rtc streams is not defined (#5150) --- web/src/routes/Camera.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/routes/Camera.jsx b/web/src/routes/Camera.jsx index 3be2bfb71..0d3f86df3 100644 --- a/web/src/routes/Camera.jsx +++ b/web/src/routes/Camera.jsx @@ -25,7 +25,7 @@ export default function Camera({ camera }) { const [viewMode, setViewMode] = useState('live'); const cameraConfig = config?.cameras[camera]; - const restreamEnabled = cameraConfig && Object.keys(config.go2rtc.streams).includes(cameraConfig.live.stream_name); + const restreamEnabled = cameraConfig && Object.keys(config.go2rtc.streams || {}).includes(cameraConfig.live.stream_name); const jsmpegWidth = cameraConfig ? Math.round(cameraConfig.live.height * (cameraConfig.detect.width / cameraConfig.detect.height)) : 0;