Check element is valid before requesting type (EA-74737)

This commit is contained in:
Nikolay Krasko
2016-02-10 14:50:53 +03:00
parent eabe675dbf
commit 9b44b0b1c0
@@ -85,8 +85,10 @@ public class RemovePartsFromPropertyFix extends KotlinQuickFixAction<KtProperty>
@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