package o; import io.reactivex.rxjava3.exceptions.CompositeException; /* loaded from: classes.dex */ public final class fWF extends fUX { private fSS> b; public fWF(InterfaceC13169fSq interfaceC13169fSq, fSS> fss) { super(interfaceC13169fSq); this.b = fss; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { HBt hBt = new HBt(interfaceC13174fSv, this.b); interfaceC13174fSv.onSubscribe(hBt.b); this.c.subscribe(hBt); } /* loaded from: classes6.dex */ static final class HBt implements InterfaceC13174fSv { private boolean a; final C13197fTk b = new C13197fTk(); private boolean c; private fSS> d; private InterfaceC13174fSv e; HBt(InterfaceC13174fSv interfaceC13174fSv, fSS> fss) { this.e = interfaceC13174fSv; this.d = fss; } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.a) { return; } this.e.onNext(t); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.c) { if (this.a) { C13418fZu.c(th); return; } else { this.e.onError(th); return; } } this.c = true; try { InterfaceC13169fSq a = this.d.a(th); if (a == null) { NullPointerException nullPointerException = new NullPointerException("Observable is null"); nullPointerException.initCause(th); this.e.onError(nullPointerException); return; } a.subscribe(this); } catch (Throwable th2) { C13147fSI.c(th2); this.e.onError(new CompositeException(th, th2)); } } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.a) { return; } this.a = true; this.c = true; this.e.onComplete(); } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { EnumC13192fTf.c(this.b, fsj); } } }