NPE fix in StackFrameInterceptor

This commit is contained in:
Vladimir Ilmov
2020-04-08 21:25:57 +02:00
parent 08b91da6db
commit ed56aa3e0d
@@ -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