[bluetooth.bluez] Fix NullPointerException during discovery (#15347)

Signed-off-by: lsiepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2023-08-01 10:24:25 +02:00 committed by Jacob Laursen
parent c3a7f38930
commit 0a503307d1

View 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"));
}