Skip to content

Commit

Permalink
[hue] Eliminate NPE in #9985 (#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 1c5f0d1 commit a9f440d
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 a9f440d

Please sign in to comment.