From ed56aa3e0dba4532b780213266afe27a1c98aeb8 Mon Sep 17 00:00:00 2001 From: Vladimir Ilmov Date: Wed, 8 Apr 2020 21:25:57 +0200 Subject: [PATCH] NPE fix in StackFrameInterceptor --- .../idea/debugger/coroutine/CoroutineStackFrameInterceptor.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/CoroutineStackFrameInterceptor.kt b/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/CoroutineStackFrameInterceptor.kt index 2173223d99f..2b797b612aa 100644 --- a/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/CoroutineStackFrameInterceptor.kt +++ b/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/CoroutineStackFrameInterceptor.kt @@ -18,7 +18,9 @@ import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.ContinuationHolder class CoroutineStackFrameInterceptor(val project: Project) : StackFrameInterceptor { override fun createStackFrame(frame: StackFrameProxyImpl, debugProcess: DebugProcessImpl, location: Location): XStackFrame? = - if (AsyncStacksToggleAction.isAsyncStacksEnabled(debugProcess.xdebugProcess?.session as XDebugSessionImpl)) + if (debugProcess.xdebugProcess?.session is XDebugSessionImpl && + AsyncStacksToggleAction.isAsyncStacksEnabled(debugProcess.xdebugProcess?.session as XDebugSessionImpl) + ) ContinuationHolder.coroutineExitFrame(frame, debugProcess.debuggerContext.suspendContext as SuspendContextImpl) else null