diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py index f560d1bcf4..a85e644940 100644 --- a/frigate/comms/dispatcher.py +++ b/frigate/comms/dispatcher.py @@ -412,8 +412,6 @@ class Dispatcher: for camera_name, features in state.items(): if camera_name not in self.config.cameras: continue - if not isinstance(features, dict): - continue for topic, value in features.items(): handler = self._camera_settings_handlers.get(topic) if handler is None: diff --git a/frigate/comms/runtime_state.py b/frigate/comms/runtime_state.py index c3f1639f09..5066ed3993 100644 --- a/frigate/comms/runtime_state.py +++ b/frigate/comms/runtime_state.py @@ -48,7 +48,14 @@ class RuntimeStatePersistence: logger.error("Timed out acquiring runtime state lock for load") return {} cameras = data.get("cameras", {}) - return cameras if isinstance(cameras, dict) else {} + if not isinstance(cameras, dict): + return {} + # Filter out malformed camera entries so callers can trust the shape. + return { + name: features + for name, features in cameras.items() + if isinstance(features, dict) + } def set(self, camera: str, topic: str, value: bool) -> None: """Persist a single (camera, topic, value). No-op if topic untracked."""