package i0; import d0.k; import d0.l; import f0.z; import java.lang.reflect.Method; import java.util.Objects; import kotlin.KotlinNullPointerException; import kotlinx.coroutines.CancellableContinuation; import retrofit2.HttpException; /* compiled from: KotlinExtensions.kt */ public final class m implements f { public final /* synthetic */ CancellableContinuation a; public m(CancellableContinuation cancellableContinuation) { this.a = cancellableContinuation; } @Override // i0.f public void a(d dVar, Throwable th) { d0.z.d.m.checkParameterIsNotNull(dVar, "call"); d0.z.d.m.checkParameterIsNotNull(th, "t"); CancellableContinuation cancellableContinuation = this.a; k.a aVar = k.i; cancellableContinuation.resumeWith(k.m78constructorimpl(l.createFailure(th))); } @Override // i0.f public void b(d dVar, x xVar) { d0.z.d.m.checkParameterIsNotNull(dVar, "call"); d0.z.d.m.checkParameterIsNotNull(xVar, "response"); if (xVar.a()) { T t = xVar.b; if (t == 0) { z c2 = dVar.c(); Objects.requireNonNull(c2); d0.z.d.m.checkParameterIsNotNull(k.class, "type"); Object cast = k.class.cast(c2.f.get(k.class)); if (cast == null) { d0.z.d.m.throwNpe(); } d0.z.d.m.checkExpressionValueIsNotNull(cast, "call.request().tag(Invocation::class.java)!!"); Method method = ((k) cast).a; StringBuilder sb = new StringBuilder(); sb.append("Response from "); d0.z.d.m.checkExpressionValueIsNotNull(method, "method"); Class declaringClass = method.getDeclaringClass(); d0.z.d.m.checkExpressionValueIsNotNull(declaringClass, "method.declaringClass"); sb.append(declaringClass.getName()); sb.append('.'); sb.append(method.getName()); sb.append(" was null but response body type was declared as non-null"); KotlinNullPointerException kotlinNullPointerException = new KotlinNullPointerException(sb.toString()); CancellableContinuation cancellableContinuation = this.a; k.a aVar = k.i; cancellableContinuation.resumeWith(k.m78constructorimpl(l.createFailure(kotlinNullPointerException))); return; } CancellableContinuation cancellableContinuation2 = this.a; k.a aVar2 = k.i; cancellableContinuation2.resumeWith(k.m78constructorimpl(t)); return; } CancellableContinuation cancellableContinuation3 = this.a; HttpException httpException = new HttpException(xVar); k.a aVar3 = k.i; cancellableContinuation3.resumeWith(k.m78constructorimpl(l.createFailure(httpException))); } }