From 69353ee9bf9fb76cd72a52d33ef05071948f4f1c Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 27 Mar 2019 21:29:06 +0300 Subject: [PATCH] Async stack traces: fix compatibility with kotlin-stdlib 1.2.70 (KT-30611) --- .../debugger/KotlinCoroutinesAsyncStackTraceProvider.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt index e333a82458e..cb924c4a0a0 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt @@ -54,7 +54,12 @@ class KotlinCoroutinesAsyncStackTraceProvider : KotlinCoroutinesAsyncStackTraceP val evaluationContext = EvaluationContextImpl(suspendContext, 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) return asyncContext.getAsyncStackTraceForSuspendLambda() ?: asyncContext.getAsyncStackTraceForSuspendFunction()