map entries of member variables could change between lines (#883)

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
This commit is contained in:
Markus Rathgeb 2019-06-20 21:24:55 +02:00 committed by Kai Kreuzer
parent a75fbe1e42
commit a23cd23a37

View File

@ -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