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

CompositeException extra NPE protection #3048

Merged
merged 1 commit into from
Jul 14, 2015

Conversation

akarnokd
Copy link
Member

CompositeException won't crash if it received null by some means. A null collection or null collection item is replaced by a NullPointerException instance.

See also: #3046.

if (ex instanceof CompositeException) {
deDupedExceptions.addAll(((CompositeException) ex).getExceptions());
} else
if (ex != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move if (ex != null) { to the same line of else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This is my style of coding and there is no style guide for RxJava anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was unintentional. Never mind. See this style for the first time :)

benjchristensen added a commit that referenced this pull request Jul 14, 2015
CompositeException extra NPE protection
@benjchristensen benjchristensen merged commit df5de06 into ReactiveX:1.x Jul 14, 2015
@akarnokd akarnokd deleted the CompositeExceptionNull branch July 14, 2015 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants