diff --git a/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/GenericBluetoothHandler.java b/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/GenericBluetoothHandler.java index 4fd4b206bb660..22ab071c446d5 100644 --- a/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/GenericBluetoothHandler.java +++ b/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/GenericBluetoothHandler.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledFuture; @@ -183,7 +184,7 @@ private void updateThingChannels() { } private CharacteristicHandler getCharacteristicHandler(BluetoothCharacteristic characteristic) { - return charHandlers.computeIfAbsent(characteristic, CharacteristicHandler::new); + return Objects.requireNonNull(charHandlers.computeIfAbsent(characteristic, CharacteristicHandler::new)); } private boolean readCharacteristic(BluetoothCharacteristic characteristic) {