Skip to content

java.lang.IllegalArgumentException: Paramater specified as non-null is null #23

Open
@bonesyblue

Description

@bonesyblue

Hi Espressif 👋🏼 I receive the following stack trace, when attempting to perform a connect with the BlufiClient class. In both cases, a new client instance is created and the callback onServicesDiscovered is invocated.

Stack trace:

D/AndroidRuntime(21812): Shutting down VM
E/AndroidRuntime(21812): FATAL EXCEPTION: main
E/AndroidRuntime(21812): Process: com.example.severin_smart_control, PID: 21812
E/AndroidRuntime(21812): java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter service
E/AndroidRuntime(21812): 	at de.nuuk.severin.ebbq.severin_ebbq_plugin.SeverinEbbqPlugin$BlufiCallbackMain.onGattPrepared(Unknown Source:12)
E/AndroidRuntime(21812): 	at blufi.espressif.BlufiClientImpl$InnerGattCallback.lambda$onServicesDiscovered$0$BlufiClientImpl$InnerGattCallback(BlufiClientImpl.java:1210)
E/AndroidRuntime(21812): 	at blufi.espressif.-$$Lambda$BlufiClientImpl$InnerGattCallback$qPjo5mhKgJ_bnJKk3XqrSwssJ8o.run(Unknown Source:10)
E/AndroidRuntime(21812): 	at android.os.Handler.handleCallback(Handler.java:873)
E/AndroidRuntime(21812): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(21812): 	at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(21812): 	at android.app.ActivityThread.main(ActivityThread.java:6718)
E/AndroidRuntime(21812): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(21812): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(21812): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

From what I understand reading the BlufiClientImpl.java file, getService is potentially returning null and this is not checked before being provided as an argument to onGattPrepared.

service = gatt.getService(BlufiParameter.UUID_SERVICE);

I would be very grateful for your feedback on this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions