prevent NPE

This commit is contained in:
Milos Kozak 2021-01-15 13:37:30 +01:00
parent 534b27cb71
commit d300a95e39

View file

@ -81,11 +81,13 @@ public class QueueThread extends Thread {
pump.stopConnecting(); pump.stopConnecting();
pump.disconnect("watchdog"); pump.disconnect("watchdog");
SystemClock.sleep(1000); SystemClock.sleep(1000);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.disable(); if (bluetoothAdapter != null) {
bluetoothAdapter.disable();
SystemClock.sleep(1000); SystemClock.sleep(1000);
mBluetoothAdapter.enable(); bluetoothAdapter.enable();
SystemClock.sleep(1000); SystemClock.sleep(1000);
}
//start over again once after watchdog barked //start over again once after watchdog barked
//Notification notification = new Notification(Notification.OLD_NSCLIENT, "Watchdog", Notification.URGENT); //Notification notification = new Notification(Notification.OLD_NSCLIENT, "Watchdog", Notification.URGENT);
//rxBus.send(new EventNewNotification(notification)); //rxBus.send(new EventNewNotification(notification));