fix crashlytics: if user shuts off bluetooth during scan, ignore failure

This commit is contained in:
Kevin Hester
2020-03-03 11:00:01 -08:00
parent 64e4e05a0b
commit 4bce536506

View File

@@ -43,7 +43,11 @@ object ScanState : Logging {
fun stopScan() {
if (callback != null) {
debug("stopping scan")
scanner!!.stopScan(callback)
try {
scanner!!.stopScan(callback)
} catch(ex: Throwable) {
warn("Ignoring error stopping scan, probably BT adapter was disabled suddenly: ${ex.message}")
}
callback = null
}
}