fix autobug when gatt is being destroyed

This commit is contained in:
geeksville 2020-06-18 15:45:30 -07:00
parent 65014dac48
commit 323809b762

View file

@ -665,7 +665,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
private fun queueWriteDescriptor(
c: BluetoothGattDescriptor,
cont: Continuation<BluetoothGattDescriptor>
) = queueWork("writeD", cont) { gatt!!.writeDescriptor(c) }
) = queueWork("writeD", cont) { gatt?.writeDescriptor(c) ?: false }
fun asyncWriteDescriptor(
c: BluetoothGattDescriptor,