From bab1c63126c96f8963a501eb5fdf5a05d7ffc319 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 21 Feb 2019 00:52:19 +0300 Subject: [PATCH] Fix EA-135863: Access allLineLocations() safely --- .../idea/debugger/stepping/KotlinSteppingCommandProvider.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt index de327a73cbc..ffe0af03999 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt @@ -339,7 +339,11 @@ fun getStepOverAction( val project = sourceFile.project - val methodLocations = location.method().allLineLocations() + val methodLocations = location.method().safeAllLineLocations() + if (methodLocations.isEmpty()) { + return Action.STEP_OVER() + } + val locationsLineAndFile = methodLocations.keysToMap { ktLocationInfo(it, isDexDebug, project, true) } fun Location.ktLineNumber(): Int = (locationsLineAndFile[this] ?: ktLocationInfo(this, isDexDebug, project, true)).first