1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-24 05:50:47 +02:00

Added a safety measure against a weird internal crash when stopping a BLE scan

This commit is contained in:
TaaviE 2020-06-15 16:34:17 +03:00 committed by Gitea
parent a3f9b8a187
commit d871b03f33

View File

@ -482,7 +482,12 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
LOG.warn("newLeScanCallback == null!");
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) {