From 082671199415f81d1a0cb9b95ecf66d26ef80638 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Wed, 23 Nov 2022 06:11:40 -0700 Subject: [PATCH] Catch bad set commands --- frigate/comms/dispatcher.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py index 028184866..79954d5bd 100644 --- a/frigate/comms/dispatcher.py +++ b/frigate/comms/dispatcher.py @@ -57,9 +57,13 @@ class Dispatcher: def _receive(self, topic: str, payload: str) -> None: """Handle receiving of payload from communicators.""" if topic.endswith("set"): - camera_name = topic.split("/")[-3] - command = topic.split("/")[-2] - self._camera_settings_handlers[command](camera_name, payload) + try: + camera_name = topic.split("/")[-3] + command = topic.split("/")[-2] + self._camera_settings_handlers[command](camera_name, payload) + except Exception as e: + logger.error(f"Received invalid set command: {topic}") + return elif topic == "restart": restart_frigate()