package kotlinx.coroutines.internal;

import F1.y0;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public abstract class m {
    private static final n a(Throwable th, String str) throws Throwable {
        if (th != null) {
            throw th;
        }
        c();
        throw new n1.d();
    }

    static /* synthetic */ n b(Throwable th, String str, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            th = null;
        }
        if ((i2 & 2) != 0) {
            str = null;
        }
        return a(th, str);
    }

    public static final Void c() {
        throw new IllegalStateException("Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'");
    }

    public static final y0 d(MainDispatcherFactory mainDispatcherFactory, List list) {
        try {
            return mainDispatcherFactory.createDispatcher(list);
        } catch (Throwable th) {
            return a(th, mainDispatcherFactory.hintOnError());
        }
    }
}
