From d7a5dc23894128a99ef0f3e3fc52d72aaf95346c Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Fri, 27 Aug 2021 23:28:11 +0200 Subject: [PATCH] Fix Potential null pointer access Fixes #11167 Signed-off-by: Jacob Laursen --- .../danfossairunit/internal/DanfossAirUnitHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnitHandler.java b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnitHandler.java index 19514396a1ac5..f1bc9ddb1cb23 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnitHandler.java +++ b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnitHandler.java @@ -164,7 +164,12 @@ private synchronized void stopPolling() { } private void updateState(String groupId, String channelId, State state) { - if (valueCache.updateValue(channelId, state)) { + ValueCache cache = valueCache; + if (cache == null) { + return; + } + + if (cache.updateValue(channelId, state)) { updateState(new ChannelUID(thing.getUID(), groupId, channelId), state); } }