From 451aeb6b4acdcd0e51562582fd0644430d7d623c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20L=27hopital?= Date: Wed, 12 Jul 2023 08:44:15 +0200 Subject: [PATCH] Resolves issue #15210 (#15212) Signed-off-by: clinique --- .../binding/netatmo/internal/api/dto/HomeData.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/api/dto/HomeData.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/api/dto/HomeData.java index 0a971c6b8..94bba8e54 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/api/dto/HomeData.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/api/dto/HomeData.java @@ -39,14 +39,17 @@ public class HomeData extends NAThing implements NAModule, LocationEx { } public class Security extends HomeData { - private NAObjectMap persons = new NAObjectMap<>(); + private @Nullable NAObjectMap persons; public NAObjectMap getPersons() { - return persons; + NAObjectMap localPersons = persons; + return localPersons != null ? localPersons : new NAObjectMap<>(); } public List getKnownPersons() { - return persons.values().stream().filter(HomeDataPerson::isKnown).toList(); + NAObjectMap localPersons = persons; + return localPersons != null ? localPersons.values().stream().filter(HomeDataPerson::isKnown).toList() + : List.of(); } }