From: lsiepel Date: Tue, 1 Aug 2023 08:24:25 +0000 (+0200) Subject: [bluetooth.bluez] Fix `NullPointerException` during discovery (#15347) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=d499f2c777b58fe1d54c2fbad322aa893ec9507d;p=openhab-addons.git [bluetooth.bluez] Fix `NullPointerException` during discovery (#15347) Signed-off-by: lsiepel --- diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java index 95bcebeda3..5eba04c9b8 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java @@ -469,7 +469,7 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv @Override public CompletableFuture readCharacteristic(BluetoothCharacteristic characteristic) { BluetoothDevice dev = device; - if (dev == null || !dev.isConnected()) { + if (dev == null || !Boolean.TRUE.equals(dev.isConnected())) { return CompletableFuture .failedFuture(new IllegalStateException("DBusBlueZ device is not set or not connected")); }