From b599c622c4c1dfd05d92baa439ee18f0f371dea0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 16 Aug 2019 19:15:00 +0200 Subject: [PATCH] _get_camera should first verify both that camera is not null and not closed before returning the cached object --- platypush/plugins/camera/pi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/camera/pi.py b/platypush/plugins/camera/pi.py index ab359ed1..773e5749 100644 --- a/platypush/plugins/camera/pi.py +++ b/platypush/plugins/camera/pi.py @@ -63,7 +63,7 @@ class CameraPiPlugin(CameraPlugin): # noinspection PyUnresolvedReferences,PyPackageRequirements def _get_camera(self, **opts): - if self._camera: + if self._camera and not self._camera.closed: return self._camera import picamera