Skip to content

Commit

Permalink
[hue] Eliminate NPE in openhab#9985 (openhab#10199)
Browse files Browse the repository at this point in the history
* [hue] extra null check

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
  • Loading branch information
andrewfg authored Feb 19, 2021
1 parent aa32875 commit e950100
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ public long getRemovalGracePeriodSeconds(RemoteDevice device) {
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
Expand Down

0 comments on commit e950100

Please sign in to comment.