From 9c16f3c6f52e62c0a1c731ef0ada091699882bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20Gr=C3=B8dum?= Date: Wed, 23 Sep 2020 20:20:20 +0200 Subject: [PATCH] [hueemulation] Fixed nullpointer in adjustedColorStateFromItemState (#8560) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Grødum --- .../java/org/openhab/io/hueemulation/internal/StateUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 21cc00232..5b2916ba1 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; }