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

Fix NPE when iterable is null #1750

Merged
merged 1 commit into from
Oct 13, 2014

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Oct 12, 2014

As per #1676, I prefer that throwing an NullPointerException in the constructor of OnSubscribeFromIterable.

BTW, because https://github.com/ReactiveX/RxJava/blob/v1.0.0-rc.5/src/main/java/rx/internal/operators/OnSubscribeFromIterable.java#L43 does not return after o.onCompleted();, there is still a NPE bug here.

@benjchristensen
Copy link
Member

there is still a NPE bug here

Ha. There sure is :-)

@benjchristensen
Copy link
Member

Thanks. I agree with this change. Does anyone disagree?

@akarnokd
Copy link
Member

The question is, do we apply this kind of parameter checks everywhere else? Rx.NET does this all the time.

@benjchristensen
Copy link
Member

What other places need it? Many places null is valid. Let's put the checks where they should exist and we are missing them.

benjchristensen added a commit that referenced this pull request Oct 13, 2014
@benjchristensen benjchristensen merged commit df781e1 into ReactiveX:1.x Oct 13, 2014
@zsxwing zsxwing deleted the OnSubscribeFromIterabl-NPE branch October 13, 2014 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants