Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ImprovDevice name nullable [breaking change] #3

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

jpelgrom
Copy link
Collaborator

Make the name of ImprovDevices nullable to fix the following crash that may occur:

FATAL EXCEPTION: main
java.lang.NullPointerException: name must not be null
	at com.wifi.improv.ImprovManager$scanCallback$1.onScanResult(ImprovManager.kt:46)
	at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:568)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8592)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

The library already acknowledge that it may be null internally:

Log.i(TAG, "Found BLE device! Name: ${name ?: "Unnamed"}, address: $address")

@jpelgrom jpelgrom merged commit 453e008 into improv-wifi:main Oct 8, 2024
1 check passed
@jpelgrom jpelgrom deleted the fix-improvdevice-name-null branch October 8, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants