Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit e2cdd15

Browse files
committed
Fix yet another crash
1 parent 52cc8fe commit e2cdd15

File tree

1 file changed

+6
-2
lines changed
  • app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle

1 file changed

+6
-2
lines changed

app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,14 @@ PendingIntent getScanCallbackIntent(boolean newUuid) {
416416
private void stopBleBackgroundScan() {
417417
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
418418
mHandler.removeCallbacks(mReduceBleScanIntervalRunnable);
419-
mBluetoothScanner.stopScan(getScanCallbackIntent(false));
419+
if(mBluetoothScanner != null) {
420+
mBluetoothScanner.stopScan(getScanCallbackIntent(false));
421+
}
420422
} else {
421423
mHandler.removeCallbacks(mRestartRunnable);
422-
mBluetoothScanner.stopScan(mScanCallback);
424+
if(mBluetoothScanner != null) {
425+
mBluetoothScanner.stopScan(mScanCallback);
426+
}
423427
}
424428
}
425429

0 commit comments

Comments
 (0)