mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Added a safety measure against a weird internal crash when stopping a BLE scan
This commit is contained in:
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user