From: Nicolai Grødum Date: Wed, 23 Sep 2020 18:20:20 +0000 (+0200) Subject: [hueemulation] Fixed nullpointer in adjustedColorStateFromItemState (#8560) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=9c16f3c6f52e62c0a1c731ef0ada091699882bde;p=openhab-addons.git [hueemulation] Fixed nullpointer in adjustedColorStateFromItemState (#8560) Signed-off-by: Nicolai Grødum --- diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java index 21cc002328..5b2916ba1f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java @@ -450,7 +450,8 @@ public class StateUtils { } } } else if (lastCommand instanceof PercentType) { - if (hueState instanceof HueStateBulb && itemState.as(PercentType.class).equals(lastCommand)) { + if (hueState instanceof HueStateBulb && itemState != null + && lastCommand.equals(itemState.as(PercentType.class))) { if (lastHueChange.bri != null) { ((HueStateBulb) hueState).bri = lastHueChange.bri; }