From 5504048c228fdf4e9e14426886e4fdca818fdf36 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 26 Feb 2020 11:33:50 +0100 Subject: [PATCH] Don't iterate on data if data is None --- platypush/backend/sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/backend/sensor/__init__.py b/platypush/backend/sensor/__init__.py index 99d422fc9..0a2bf887e 100644 --- a/platypush/backend/sensor/__init__.py +++ b/platypush/backend/sensor/__init__.py @@ -100,7 +100,7 @@ class SensorBackend(Backend): reload = True time.sleep(5) - if self.enabled_sensors: + if self.enabled_sensors and data is not None: data = { sensor: data[sensor] for sensor, enabled in self.enabled_sensors.items()