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

NPE on livedata-support when calling clear() #257

Closed
beigirad opened this issue Jan 28, 2022 · 0 comments · Fixed by #258
Closed

NPE on livedata-support when calling clear() #257

beigirad opened this issue Jan 28, 2022 · 0 comments · Fixed by #258
Labels

Comments

@beigirad
Copy link
Contributor

I got this exception when using .asLiveData:

 java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter propertyName
        at com.chibatching.kotpref.livedata.KotprefLiveDataExtensionsKt$asLiveData$1.onSharedPreferenceChanged(Unknown Source:9)

because of:

String: The key of the preference that was changed, added, or removed. Apps targeting Build.VERSION_CODES.R on devices running OS versions Android R or later, will receive a null value when preferences are cleared.

source

chibatching added a commit that referenced this issue Jan 29, 2022
Fix #257 : NPE of livedata on clearing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants