24 lines
722 B
Java
24 lines
722 B
Java
package com.jakewharton.rxbinding2.internal;
|
|
|
|
import android.os.Looper;
|
|
import io.reactivex.Observer;
|
|
import io.reactivex.disposables.Disposables;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class Preconditions {
|
|
public static void a(Object obj, String str) {
|
|
if (obj == null) {
|
|
throw new NullPointerException(str);
|
|
}
|
|
}
|
|
|
|
public static boolean a(Observer<?> observer) {
|
|
if (Looper.myLooper() == Looper.getMainLooper()) {
|
|
return true;
|
|
}
|
|
observer.onSubscribe(Disposables.b());
|
|
observer.onError(new IllegalStateException("Expected to be called on the main thread but was " + Thread.currentThread().getName()));
|
|
return false;
|
|
}
|
|
}
|