From 323809b762694cf385b1679d6fa0d99418461e8c Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 18 Jun 2020 15:45:30 -0700 Subject: [PATCH] fix autobug when gatt is being destroyed --- app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt b/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt index 219ff1141..2a4ba76ed 100644 --- a/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt +++ b/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt @@ -665,7 +665,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD private fun queueWriteDescriptor( c: BluetoothGattDescriptor, cont: Continuation - ) = queueWork("writeD", cont) { gatt!!.writeDescriptor(c) } + ) = queueWork("writeD", cont) { gatt?.writeDescriptor(c) ?: false } fun asyncWriteDescriptor( c: BluetoothGattDescriptor,