From 9b44b0b1c01f3ab115a3832534540b94987e2c94 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 10 Feb 2016 14:50:53 +0300 Subject: [PATCH] Check element is valid before requesting type (EA-74737) --- .../kotlin/idea/quickfix/RemovePartsFromPropertyFix.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/RemovePartsFromPropertyFix.java b/idea/src/org/jetbrains/kotlin/idea/quickfix/RemovePartsFromPropertyFix.java index ad3b23416a7..fd531277e9e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/RemovePartsFromPropertyFix.java +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/RemovePartsFromPropertyFix.java @@ -85,8 +85,10 @@ public class RemovePartsFromPropertyFix extends KotlinQuickFixAction @Override public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiFile file) { + if (!super.isAvailable(project, editor, file)) return false; + KotlinType type = QuickFixUtil.getDeclarationReturnType(getElement()); - return super.isAvailable(project, editor, file) && type != null && !type.isError(); + return type != null && !type.isError(); } @Override