Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hue] Eliminate NPE in #9985 #10199

Merged
merged 11 commits into from
Feb 19, 2021
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