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

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

Merged
merged 1 commit into from
Oct 19, 2016
Merged

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

merged 1 commit into from
Oct 19, 2016

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
@@ -47,7 +48,7 @@ public FlowableToListSingle(Publisher<T> source, Callable<U> collectionSupplier)
protected void subscribeActual(SingleObserver<? super U> s) {
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