[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 GitHub
parent 3e1686b1f7
commit d499f2c777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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