We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BluetoothDisabledException
IllegalStateException
1 parent b2f4954 commit 2e013c0Copy full SHA for 2e013c0
1 file changed
core/src/androidMain/kotlin/Scanner.kt
@@ -35,7 +35,7 @@ public class AndroidScanner internal constructor(
35
?: error("Bluetooth not supported")
36
37
public override val advertisements: Flow<Advertisement> = callbackFlow {
38
- val scanner = checkNotNull(bluetoothAdapter.bluetoothLeScanner) { "Bluetooth disabled." }
+ val scanner = bluetoothAdapter.bluetoothLeScanner ?: throw BluetoothDisabledException()
39
40
val callback = object : ScanCallback() {
41
override fun onScanResult(callbackType: Int, result: ScanResult) {
0 commit comments