Closed david-gettins closed 6 months ago
Here is the stack trace up to the point were it hits my code:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.BluetoothGattServer.cancelConnection(android.bluetooth.BluetoothDevice)' on a null object reference
at no.nordicsemi.android.ble.BleServerManager.cancelConnection(BleServerManager.java:190)
at no.nordicsemi.android.ble.BleManagerHandler.internalDisconnect(BleManagerHandler.java:746)
at no.nordicsemi.android.ble.BleManagerHandler.nextRequest(BleManagerHandler.java:3495)
at no.nordicsemi.android.ble.BleManagerHandler.enqueue(BleManagerHandler.java:1550)
at no.nordicsemi.android.ble.Request.enqueue(Request.java:1209)
at no.nordicsemi.android.ble.TimeoutableRequest.enqueue(TimeoutableRequest.java:106)
at no.nordicsemi.android.ble.ktx.RequestSuspendKt.suspendCancellable(RequestSuspend.kt:406)
at no.nordicsemi.android.ble.ktx.RequestSuspendKt.suspend(RequestSuspend.kt:40)
For now I have downgraded to v2.6.1
and the exception is not thrown. I haven't tried v2.7.0
or v2.7.1
.
I have recently updated to
v2.7.2
amongst other oddities I have found disconnect throws aNullPointerException
every time I call it.To Reproduce
disconnect.enqueue()
or.suspend()
Notes
The peripheral is disconnected despite the
NullPointerException
. I verified this by scanning for it after disconnect and seeing the error.