Skip to content

Commit

Permalink
fix(android): fix crash stopScanning with BLE adapter off #317 (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
squio authored Apr 15, 2022
1 parent cfb0b1e commit 07dbd45
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,12 @@ class BluetoothLe : Plugin() {
@PluginMethod
fun stopLEScan(call: PluginCall) {
assertBluetoothAdapter(call) ?: return
deviceScanner?.stopScanning()
try {
deviceScanner?.stopScanning()
}
catch (e: IllegalStateException) {
Log.e(TAG, "Error in stopLEScan: ${e.localizedMessage}")
}
call.resolve()
}

Expand Down

0 comments on commit 07dbd45

Please sign in to comment.