From a23cd23a37c6771b7311180d497a721d832efa3f Mon Sep 17 00:00:00 2001 From: Markus Rathgeb Date: Thu, 20 Jun 2019 21:24:55 +0200 Subject: [PATCH] map entries of member variables could change between lines (#883) Signed-off-by: Markus Rathgeb --- .../thing/internal/firmware/FirmwareUpdateServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.core.thing/src/main/java/org/eclipse/smarthome/core/thing/internal/firmware/FirmwareUpdateServiceImpl.java b/bundles/org.openhab.core.thing/src/main/java/org/eclipse/smarthome/core/thing/internal/firmware/FirmwareUpdateServiceImpl.java index a431b037f..1b4048b8c 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/eclipse/smarthome/core/thing/internal/firmware/FirmwareUpdateServiceImpl.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/eclipse/smarthome/core/thing/internal/firmware/FirmwareUpdateServiceImpl.java @@ -274,11 +274,12 @@ public final class FirmwareUpdateServiceImpl implements FirmwareUpdateService, E } protected ProgressCallbackImpl getProgressCallback(ThingUID thingUID) { - if (!progressCallbackMap.containsKey(thingUID)) { + final ProgressCallbackImpl entry = progressCallbackMap.get(thingUID); + if (entry == null) { throw new IllegalStateException( String.format("No ProgressCallback available for thing with UID %s.", thingUID)); } - return progressCallbackMap.get(thingUID); + return entry; } @Nullable