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

This commit is contained in:
TaaviE
2020-06-17 08:47:39 +02:00
committed by Gitea
parent a3f9b8a187
commit d871b03f33
@@ -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) {