Async stack traces: fix compatibility with kotlin-stdlib 1.2.70 (KT-30611)
This commit is contained in:
+6
-1
@@ -54,7 +54,12 @@ class KotlinCoroutinesAsyncStackTraceProvider : KotlinCoroutinesAsyncStackTraceP
|
|||||||
val evaluationContext = EvaluationContextImpl(suspendContext, frameProxy)
|
val evaluationContext = EvaluationContextImpl(suspendContext, frameProxy)
|
||||||
val context = ExecutionContext(evaluationContext, frameProxy)
|
val context = ExecutionContext(evaluationContext, frameProxy)
|
||||||
|
|
||||||
val debugMetadataKtType = context.findClass(DEBUG_METADATA_KT) as? ClassType ?: return null
|
val debugMetadataKtType = try {
|
||||||
|
context.findClass(DEBUG_METADATA_KT) as? ClassType
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
// DebugMetadataKt not found, probably old kotlin-stdlib version
|
||||||
|
return null
|
||||||
|
} ?: return null
|
||||||
|
|
||||||
val asyncContext = AsyncStackTraceContext(context, method, debugMetadataKtType)
|
val asyncContext = AsyncStackTraceContext(context, method, debugMetadataKtType)
|
||||||
return asyncContext.getAsyncStackTraceForSuspendLambda() ?: asyncContext.getAsyncStackTraceForSuspendFunction()
|
return asyncContext.getAsyncStackTraceForSuspendLambda() ?: asyncContext.getAsyncStackTraceForSuspendFunction()
|
||||||
|
|||||||
Reference in New Issue
Block a user