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

Fix: NPE in requestFromChild method. #2875

Merged
merged 1 commit into from
Apr 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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