Skip to content

2.x: Delegate null Collections down to onError in toList#4731

Merged
akarnokd merged 1 commit intoReactiveX:2.xfrom
vanniktech:on_error
Oct 19, 2016
Merged

2.x: Delegate null Collections down to onError in toList#4731
akarnokd merged 1 commit intoReactiveX:2.xfrom
vanniktech:on_error

Conversation

@vanniktech
Copy link
Collaborator

  • if null from a collection supplier is returned delegate to onError
  • adapted Flowable & Observable
  • unified exception message

@akarnokd akarnokd added this to the 2.0 RC5 milestone 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.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, is there a place where null values are allowed? The use of "generally" seems to imply such.

Copy link
Contributor

Choose a reason for hiding this comment

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

(and yes I know we use this wording everywhere)

Copy link
Member

Choose a reason for hiding this comment

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

using's resource supplier can return null, we don't complain about null resources.

@codecov-io
Copy link

Current coverage is 91.41% (diff: 100%)

Merging #4731 into 2.x will increase coverage by 0.08%

@@                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   

Powered by Codecov. Last update 9e18df6...76fd3f9

@akarnokd akarnokd merged commit 3e7d63c into ReactiveX:2.x Oct 19, 2016
@vanniktech vanniktech deleted the on_error branch October 19, 2016 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants