From 81a200bd4efc78603a29b77625d287269e399c90 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 17 Mar 2019 02:16:41 +0100 Subject: [PATCH] Make sure that device_id is in _is_recording and hasn't been removed by another thread before checking it --- platypush/plugins/camera/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/camera/__init__.py b/platypush/plugins/camera/__init__.py index 8d14b0662..76bef7cec 100644 --- a/platypush/plugins/camera/__init__.py +++ b/platypush/plugins/camera/__init__.py @@ -270,7 +270,7 @@ class CameraPlugin(Plugin): self.fire_event(CameraRecordingStartedEvent(**evt_args)) - while self._is_recording[device_id].is_set(): + while device_id in self._is_recording and self._is_recording[device_id].is_set(): if duration and time.time() - recording_started_time >= duration \ or n_frames and captured_frames >= n_frames: break