[hue] Eliminate NPE in ()

* [hue] extra null check

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2021-02-19 19:16:26 +00:00 committed by GitHub
parent 1c5f0d1797
commit a9f440dba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -119,10 +119,12 @@ public class HueBridgeDiscoveryParticipant implements UpnpDiscoveryParticipant {
try {
Configuration conf = configAdmin.getConfiguration("binding.hue");
Dictionary<String, @Nullable Object> properties = conf.getProperties();
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
}