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

NullPointerException with flatMap version that handles notification handling #3180

Closed
mikegr opened this issue Aug 24, 2015 · 2 comments
Closed
Labels

Comments

@mikegr
Copy link

mikegr commented Aug 24, 2015

The following code works with RxJava 1.0.12, but throws a NullPointerException with 1.0.13 and 1.0.14

Observable.just(1)
                .flatMap(
                        item -> Observable.just(item + 1),
                        e -> Observable.error(e),
                        () -> Observable.never())
                .subscribe(
                        i -> {
                            Log.d(TAG, "Got " + i);
                        },
                        e -> {
                            Log.d(TAG, "RxJava ERROR", e);
                        });

java.lang.NullPointerException: Attempt to invoke virtual method 'void rx.internal.operators.OperatorMapNotification$SingleEmitter.offer(java.lang.Object)' on a null object reference
at rx.internal.operators.OperatorMapNotification$1.onNext(OperatorMapNotification.java:82)
at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:46)
at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:35)
at rx.Observable$1.call(Observable.java:145)
at rx.Observable$1.call(Observable.java:137)
at rx.Observable$1.call(Observable.java:145)
at rx.Observable$1.call(Observable.java:137)
at rx.Observable.subscribe(Observable.java:7803)
at rx.Observable.subscribe(Observable.java:7579)

Further notice: Observable.just(1,2,3) works fine on all versions.

@akarnokd
Copy link
Member

Thanks for reporting. #3181 fixes this issue.

@akarnokd
Copy link
Member

akarnokd commented Sep 9, 2015

Fix merged via #3181 and will be delivered in 1.0.15.

@akarnokd akarnokd closed this as completed Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants