You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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 asString?
instead of simplyString
Noticed that when getting a NPE in my code:
scanResult.bleDevice.name.startsWith("EXAMPLE-", true)
give an exception:The text was updated successfully, but these errors were encountered: