mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 17:27:24 +01:00
Do not crash on null BT adapter, allows UI work on emulator.
This commit is contained in:
parent
57ecba16f3
commit
3ef942b5d3
@ -290,6 +290,11 @@ public class DiscoveryActivity extends Activity implements AdapterView.OnItemCli
|
||||
return false;
|
||||
}
|
||||
BluetoothAdapter adapter = bluetoothService.getAdapter();
|
||||
if (adapter == null) {
|
||||
LOG.warn("No bluetooth available");
|
||||
this.adapter = null;
|
||||
return false;
|
||||
}
|
||||
if (!adapter.isEnabled()) {
|
||||
LOG.warn("Bluetooth not enabled");
|
||||
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||
|
Loading…
Reference in New Issue
Block a user