-
Notifications
You must be signed in to change notification settings - Fork 132
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
NullPointerException when targeting devices running OS versions Android R or later #141
Comments
This is causing issues for my app as well after updating target version to 30. Caused by: java.lang.NullPointerException: onNext called with null. Null values are generally not allowed in 2.x operators and sources. |
The easy fix here would be to add a I think we could also make it so that it emits the default value when this happens.
|
@f2prateek are you still working on this? |
I haven't worked on this - feel free to send a PR! |
@f2prateek @mseroczynski I'll try to get a PR for this with the recommend changes up sometime this week. |
…ceChangedListener returns null
…ceChangedListener returns null
…ceChangedListener returns null
…ceChangedListener returns null
…ceChangedListener returns null
I wasn't prepared to update Robolectric to support API 30, so the supplied unit test doesn't run. But, otherwise the PR in #143 fixes this in a way suggested by @f2prateek. |
…ceChangedListener returns null
Issue #141: Emit defaultValue if underlying onSharedPreferenceChanged…
Looks like there has been behavior change in OnSharedPreferenceChangeListener onSharedPreferenceChanged callback when apps target devices running OS versions Android R or later.
Now when preferences are cleared
null
key will be received in onSharedPreferenceChanged which results in app crashing due to null value being emitted to rx stream.Please see:
https://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged(android.content.SharedPreferences,%20java.lang.String)
The text was updated successfully, but these errors were encountered: