Skip to content

Commit 8a3f236

Browse files
authored
Temporary fix for bluetoothLeScanner being null when stopping a scan (#42)
1 parent e61a59a commit 8a3f236

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sample_app/src/main/java/uk/co/alt236/btlescan/util/BluetoothLeScanner.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class BluetoothLeScanner(
6060
private fun stopScan(adapter: BluetoothAdapter, reason: String) {
6161
Log.d(TAG, "~ Stopping Scan - reason: '$reason'")
6262
isScanning = false
63-
adapter.bluetoothLeScanner.stopScan(leScanCallback)
63+
adapter.bluetoothLeScanner?.stopScan(leScanCallback)
6464
}
6565

6666
private companion object {

0 commit comments

Comments
 (0)