提交 12623dbb 编写于 作者: D Dan Lew

Added extra caution before calling onError/onCompleted

The chances are low (but not zero) of an unsubscription between onNext() and
the terminal event.
上级 7b7bc5e7
......@@ -109,10 +109,14 @@ public final class RxJavaCallAdapterFactory implements CallAdapter.Factory {
try {
subscriber.onNext(response);
} catch (Throwable t) {
subscriber.onError(t);
if (!subscriber.isUnsubscribed()) {
subscriber.onError(t);
}
return;
}
subscriber.onCompleted();
if (!subscriber.isUnsubscribed()) {
subscriber.onCompleted();
}
}
@Override public void onFailure(Throwable t) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册