important fix

This commit is contained in:
Alexander Bubnov 2017-03-28 14:21:58 +03:00
parent 800a15fba6
commit ffcc6bb244
1 changed files with 9 additions and 9 deletions

View File

@ -251,20 +251,20 @@ public class BaseLifecycleBindable implements LifecycleBindable {
actualObservable = observable.observeOn(AndroidSchedulers.mainThread())
.doOnCompleted(onCompletedAction)
.doOnNext(onNextAction)
.onErrorResumeNext(throwable -> {
final boolean isRxError = throwable instanceof OnErrorThrowable;
if ((!isRxError && throwable instanceof RuntimeException)
|| (isRxError && throwable.getCause() instanceof RuntimeException)) {
Lc.assertion(throwable);
}
onErrorAction.call(throwable);
return Observable.empty();
});
.doOnError(onErrorAction);
}
return isCreatedSubject.first()
.switchMap(created -> created ? actualObservable : Observable.empty())
.takeUntil(conditionSubject.filter(condition -> condition))
.onErrorResumeNext(throwable -> {
final boolean isRxError = throwable instanceof OnErrorThrowable;
if ((!isRxError && throwable instanceof RuntimeException)
|| (isRxError && throwable.getCause() instanceof RuntimeException)) {
Lc.assertion(throwable);
}
return Observable.empty();
})
.subscribe();
}