]> git.basschouten.com Git - openhab-addons.git/commitdiff
[bluetooth.bluez] Fix `NullPointerException` during discovery (#15347)
authorlsiepel <leosiepel@gmail.com>
Tue, 1 Aug 2023 08:24:25 +0000 (10:24 +0200)
committerGitHub <noreply@github.com>
Tue, 1 Aug 2023 08:24:25 +0000 (10:24 +0200)
Signed-off-by: lsiepel <leosiepel@gmail.com>
bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java

index 95bcebeda36e7d9e0d1a6cce2425bc93368af30b..5eba04c9b8863b3f8840151eef90254a6d6db1c8 100644 (file)
@@ -469,7 +469,7 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv
     @Override
     public CompletableFuture<byte[]> 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"));
         }