Git Product home page Git Product logo

Comments (6)

davelogan avatar davelogan commented on July 17, 2024 7

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.
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:62)
at com.f2prateek.rx.preferences2.RxSharedPreferences$1$1.onSharedPreferenceChanged(RxSharedPreferences.java:44)
at android.app.SharedPreferencesImpl$EditorImpl.notifyListeners(SharedPreferencesImpl.java:629)
at android.app.SharedPreferencesImpl$EditorImpl.lambda$notifyListeners$0$SharedPreferencesImpl$EditorImpl(SharedPreferencesImpl.java:643)

from rx-preferences.

f2prateek avatar f2prateek commented on July 17, 2024 3

The easy fix here would be to add a null check here. However this would result in no notification being fired when preferences are cleared, which would be less than ideal.

I think we could also make it so that it emits the default value when this happens.

from rx-preferences.

banasiak avatar banasiak commented on July 17, 2024 2

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.

from rx-preferences.

mseroczynski avatar mseroczynski commented on July 17, 2024

@f2prateek are you still working on this?

from rx-preferences.

f2prateek avatar f2prateek commented on July 17, 2024

I haven't worked on this - feel free to send a PR!

from rx-preferences.

banasiak avatar banasiak commented on July 17, 2024

@f2prateek @mseroczynski I'll try to get a PR for this with the recommend changes up sometime this week.

from rx-preferences.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.