From c749a222ebd90771d59ce881f031631d8c47ff1f Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Mon, 2 Jul 2018 15:27:26 +0300 Subject: [PATCH] Debugger: Add a missing read action (EA-119592) --- .../idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt index 4e687de2653..e334c7e273e 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt @@ -34,6 +34,7 @@ import com.intellij.psi.search.GlobalSearchScope import com.sun.jdi.ClassType import com.sun.jdi.Value import org.jetbrains.eval4j.jdi.asValue +import org.jetbrains.kotlin.idea.util.application.runReadAction import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.types.KotlinType @@ -73,7 +74,7 @@ abstract class KotlinRuntimeTypeEvaluator( val value = evaluator.evaluate(evaluationContext) if (value != null) { - return getCastableRuntimeType(evaluationContext.debugProcess.searchScope, value) + return runReadAction { getCastableRuntimeType(evaluationContext.debugProcess.searchScope, value) } } throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.surrounded.expression.null"))