From 9c03b028d7949f521538d50509fb3c797cab7b28 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 23 Apr 2023 22:48:15 +0200 Subject: [PATCH] Be a bit more resilient if an upstream integration sent some empty entities --- platypush/entities/managers/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platypush/entities/managers/__init__.py b/platypush/entities/managers/__init__.py index 7f55d584ee..40692930f6 100644 --- a/platypush/entities/managers/__init__.py +++ b/platypush/entities/managers/__init__.py @@ -68,6 +68,9 @@ class EntityManager(ABC): def _normalize_entities(self, entities: Collection[Entity]) -> Collection[Entity]: for entity in entities: + if not entity: + continue + if entity.id and not entity.external_id: # Entity IDs can only refer to the internal primary key entity.external_id = entity.id