Skip to content

Commit

Permalink
Merge pull request #2875 from akarnokd/ConcatNPEFix
Browse files Browse the repository at this point in the history
Fix: NPE in requestFromChild method.
  • Loading branch information
akarnokd committed Apr 14, 2015
2 parents 135477e + f8373d3 commit 131a663
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/rx/internal/operators/OperatorConcat.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ public void onStart() {

private void requestFromChild(long n) {
// we track 'requested' so we know whether we should subscribe the next or not
ConcatInnerSubscriber<T> actualSubscriber = currentSubscriber;
if (REQUESTED_UPDATER.getAndAdd(this, n) == 0) {
if (currentSubscriber == null && wip > 0) {
if (actualSubscriber == null && wip > 0) {
// this means we may be moving from one subscriber to another after having stopped processing
// so need to kick off the subscribe via this request notification
subscribeNext();
Expand All @@ -124,9 +125,9 @@ private void requestFromChild(long n) {
}
}

if (currentSubscriber != null) {
if (actualSubscriber != null) {
// otherwise we are just passing it through to the currentSubscriber
currentSubscriber.requestMore(n);
actualSubscriber.requestMore(n);
}
}

Expand Down

0 comments on commit 131a663

Please sign in to comment.