2.x: Delegate null Collections down to onError in toList#4731
Merged
akarnokd merged 1 commit intoReactiveX:2.xfrom Oct 19, 2016
vanniktech:on_error
Merged
2.x: Delegate null Collections down to onError in toList#4731akarnokd merged 1 commit intoReactiveX:2.xfrom vanniktech:on_error
akarnokd merged 1 commit intoReactiveX:2.xfrom
vanniktech:on_error
Conversation
Collaborator
vanniktech
commented
Oct 19, 2016
- if null from a collection supplier is returned delegate to onError
- adapted Flowable & Observable
- unified exception message
akarnokd
approved these changes
Oct 19, 2016
JakeWharton
approved these changes
Oct 19, 2016
| U coll; | ||
| try { | ||
| coll = collectionSupplier.call(); | ||
| coll = ObjectHelper.requireNonNull(collectionSupplier.call(), "The collectionSupplier returned a null collection. Null values are generally not allowed in 2.x operators and sources."); |
Contributor
There was a problem hiding this comment.
Out of curiosity, is there a place where null values are allowed? The use of "generally" seems to imply such.
Contributor
There was a problem hiding this comment.
(and yes I know we use this wording everywhere)
Member
There was a problem hiding this comment.
using's resource supplier can return null, we don't complain about null resources.
Current coverage is 91.41% (diff: 100%)@@ 2.x #4731 diff @@
==========================================
Files 571 571
Lines 37214 37214
Methods 0 0
Messages 0 0
Branches 5674 5674
==========================================
+ Hits 33989 34021 +32
+ Misses 1865 1838 -27
+ Partials 1360 1355 -5
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.