Skip to content

Commit cbf8edf

Browse files
committed
Merge pull request #2882 from davidmoten/scan-fix
OperatorScan - don't call onNext after onError is called
2 parents 131a663 + 900beb1 commit cbf8edf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import rx.Observable.Operator;
2121
import rx.Producer;
2222
import rx.Subscriber;
23+
import rx.exceptions.Exceptions;
2324
import rx.exceptions.OnErrorThrowable;
2425
import rx.functions.Func0;
2526
import rx.functions.Func2;
@@ -103,7 +104,9 @@ public void onNext(T currentValue) {
103104
try {
104105
this.value = accumulator.call(this.value, currentValue);
105106
} catch (Throwable e) {
107+
Exceptions.throwIfFatal(e);
106108
child.onError(OnErrorThrowable.addValueAsLastCause(e, currentValue));
109+
return;
107110
}
108111
}
109112
child.onNext(this.value);

0 commit comments

Comments
 (0)