]> git.basschouten.com Git - openhab-addons.git/commitdiff
[hue] Eliminate NPE in #9985 (#10199)
authorAndrew Fiddian-Green <software@whitebear.ch>
Fri, 19 Feb 2021 19:16:26 +0000 (19:16 +0000)
committerGitHub <noreply@github.com>
Fri, 19 Feb 2021 19:16:26 +0000 (20:16 +0100)
* [hue] extra null check

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java

index d5bb4ce498354452b3be9e09dcc47ea86c979ec7..7018c62917b3a793bcc885e7f10ec7c87a7896ef 100644 (file)
@@ -119,9 +119,11 @@ public class HueBridgeDiscoveryParticipant implements UpnpDiscoveryParticipant {
         try {
             Configuration conf = configAdmin.getConfiguration("binding.hue");
             Dictionary<String, @Nullable Object> properties = conf.getProperties();
-            Object property = properties.get(HueBindingConstants.REMOVAL_GRACE_PERIOD);
-            if (property != null) {
-                removalGracePeriodSeconds = Long.parseLong(property.toString());
+            if (properties != null) {
+                Object property = properties.get(HueBindingConstants.REMOVAL_GRACE_PERIOD);
+                if (property != null) {
+                    removalGracePeriodSeconds = Long.parseLong(property.toString());
+                }
             }
         } catch (IOException | IllegalStateException | NumberFormatException e) {
             // fall through to pre-initialised (default) value