mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-07-22 14:52:25 +02:00
Added a safety measure against a weird internal crash when stopping a BLE scan
This commit is contained in:
parent
a3f9b8a187
commit
d871b03f33
|
@ -482,7 +482,12 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
|
||||||
LOG.warn("newLeScanCallback == null!");
|
LOG.warn("newLeScanCallback == null!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bluetoothLeScanner.stopScan(newLeScanCallback);
|
try {
|
||||||
|
bluetoothLeScanner.stopScan(newLeScanCallback);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
LOG.warn("Internal NullPointerException when stopping the scan!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bluetoothStateChanged(int newState) {
|
private void bluetoothStateChanged(int newState) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user