From 6b297b42a64b4d5bd51874c35a629a7064e7a28d Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Wed, 25 Oct 2023 10:26:55 +0200 Subject: [PATCH] Fix missing camera when no snapshot available Fixes #53 --- custom_components/shinobi/camera.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/shinobi/camera.py b/custom_components/shinobi/camera.py index 6cf3313..8b1e37f 100644 --- a/custom_components/shinobi/camera.py +++ b/custom_components/shinobi/camera.py @@ -94,7 +94,7 @@ def _set_stream_source(self, monitor: MonitorData): use_original_stream = config_manager.use_original_stream snapshot = monitor.snapshot - if snapshot.startswith("/"): + if snapshot and snapshot.startswith("/"): snapshot = snapshot[1:] snapshot = api.build_url(f"{{base_url}}{snapshot}")