From a8211a77d440eb9ba51397df193f416f7843b599 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 21 Sep 2017 15:10:42 +0300 Subject: [PATCH] Fix null-pointer because of nullable elementAt (EA-99963) #EA-99963 Fixed --- .../idea/debugger/stepping/KotlinSteppingCommandProvider.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt index 18bad29ada3..038100fcc8c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt @@ -108,7 +108,8 @@ class KotlinSteppingCommandProvider : JvmSteppingCommandProvider() { val file = sourcePosition.file as? KtFile ?: return null if (sourcePosition.line < 0) return null - val containingFunction = sourcePosition.elementAt.parents + val elementAt = sourcePosition.elementAt ?: return null + val containingFunction = elementAt.parents .filterIsInstance() .firstOrNull { !it.isLocal } ?: return null