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

Tag getName() as Nullable in RxBleDevice #263

Closed
vpratfr opened this issue Aug 7, 2017 · 2 comments
Closed

Tag getName() as Nullable in RxBleDevice #263

vpratfr opened this issue Aug 7, 2017 · 2 comments

Comments

@vpratfr
Copy link

vpratfr commented Aug 7, 2017

When using Kotlin, bleDevice.name is a property which is assumed to be null-safe.

This is not the case as name can be null.

An annotation @Nullable should hint Kotlin that the generated name property can have null values and should be considered as String? instead of simply String

Noticed that when getting a NPE in my code:

scanResult.bleDevice.name.startsWith("EXAMPLE-", true) give an exception:

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter $receiver
    at kotlin.text.StringsKt__StringsJVMKt.startsWith(StringsJVM.kt)
uKL added a commit that referenced this issue Aug 21, 2017
…fined as it's an optional broadcast parameter.

This fixes issue #263.
@uKL
Copy link
Collaborator

uKL commented Aug 21, 2017

Thanks for letting us know! It will be added soon.

dariuszseweryn pushed a commit that referenced this issue Aug 28, 2017
It may be undefined as it's an optional broadcast parameter.
@dariuszseweryn
Copy link
Owner

Should be available in 1.3.4-SNAPSHOT shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants