discord-jadx/app/src/main/java/j0/l/a/d0.java

51 lines
1.1 KiB
Java

package j0.l.a;
import j0.i;
import java.util.NoSuchElementException;
import rx.Subscriber;
/* compiled from: OnSubscribeSingle */
public class d0 extends Subscriber<T> {
public boolean i;
public boolean j;
public T k;
public final /* synthetic */ i l;
public d0(e0 e0Var, i iVar) {
this.l = iVar;
}
@Override // j0.g
public void onCompleted() {
if (!this.i) {
if (this.j) {
this.l.b(this.k);
} else {
this.l.a(new NoSuchElementException("Observable emitted no items"));
}
}
}
@Override // j0.g
public void onError(Throwable th) {
this.l.a(th);
unsubscribe();
}
@Override // j0.g
public void onNext(T t) {
if (this.j) {
this.i = true;
this.l.a(new IllegalArgumentException("Observable emitted too many elements"));
unsubscribe();
return;
}
this.j = true;
this.k = t;
}
@Override // rx.Subscriber
public void onStart() {
request(2);
}
}