From d65c8fb06cfb056b438a7dca01e3d961366e2137 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 7 Dec 2015 20:31:58 +0100 Subject: [PATCH] double-check action parameters (EA-76026 - KNPE: ShowExpressionTypeAction.actionPerformed) --- .../jetbrains/kotlin/idea/actions/ShowExpressionTypeAction.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/ShowExpressionTypeAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/ShowExpressionTypeAction.kt index 3f79a07ef07..43e66aa68af 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/ShowExpressionTypeAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/actions/ShowExpressionTypeAction.kt @@ -40,8 +40,8 @@ import org.jetbrains.kotlin.types.KotlinType @Deprecated("Remove once we no longer support IDEA 14.1") public class ShowExpressionTypeAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { - val editor = e.getData(CommonDataKeys.EDITOR)!! - val psiFile = e.getData(CommonDataKeys.PSI_FILE)!! + val editor = e.getData(CommonDataKeys.EDITOR) ?: return + val psiFile = e.getData(CommonDataKeys.PSI_FILE) as? KtFile ?: return val type = if (editor.getSelectionModel().hasSelection()) { val startOffset = editor.getSelectionModel().getSelectionStart()