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>
Signed-off-by: John Marshall <john.marshall.au@gmail.com>
  • Loading branch information
andrewfg authored and themillhousegroup committed May 10, 2021
1 parent 4d679fd commit 649ac78
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 649ac78

Please sign in to comment.