diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py index 2c8b26ed2..49a134a9c 100644 --- a/frigate/comms/dispatcher.py +++ b/frigate/comms/dispatcher.py @@ -103,10 +103,11 @@ class Dispatcher: # Send SIGUSR1 to resume, SIGUSR2 to pause new_state = True if payload == "ON" else False if payload == "OFF" else None if new_state is not None: - sig = signal.SIGUSR1 if new_state else signal.SIGUSR2 self.config.cameras[camera_name].capture_enabled = new_state - os.kill(capture_proc.pid, sig) self.publish(f"{camera_name}/capture/state", payload, retain=True) + if capture_proc and capture_proc.pid: + sig = signal.SIGUSR1 if new_state else signal.SIGUSR2 + os.kill(capture_proc.pid, sig) def _on_detect_command(self, camera_name: str, payload: str) -> None: """Callback for detect topic."""