Skip to content

Commit 131a663

Browse files
committed
Merge pull request #2875 from akarnokd/ConcatNPEFix
Fix: NPE in requestFromChild method.
2 parents 135477e + f8373d3 commit 131a663

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/rx/internal/operators/OperatorConcat.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ public void onStart() {
114114

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

127-
if (currentSubscriber != null) {
128+
if (actualSubscriber != null) {
128129
// otherwise we are just passing it through to the currentSubscriber
129-
currentSubscriber.requestMore(n);
130+
actualSubscriber.requestMore(n);
130131
}
131132
}
132133

0 commit comments

Comments
 (0)