diff --git a/python/src/com/jetbrains/python/codeInsight/intentions/SpecifyTypeInDocstringIntention.java b/python/src/com/jetbrains/python/codeInsight/intentions/SpecifyTypeInDocstringIntention.java index 61a621ef780d..54a20eeceb26 100644 --- a/python/src/com/jetbrains/python/codeInsight/intentions/SpecifyTypeInDocstringIntention.java +++ b/python/src/com/jetbrains/python/codeInsight/intentions/SpecifyTypeInDocstringIntention.java @@ -50,7 +50,7 @@ public class SpecifyTypeInDocstringIntention implements IntentionAction { public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { PsiElement elementAt = file.findElementAt(editor.getCaretModel().getOffset() - 1); - if (elementAt != null && !(elementAt.getNode().getElementType() == PyTokenTypes.IDENTIFIER)) + if (elementAt != null && elementAt.getNode() != null && !(elementAt.getNode().getElementType() == PyTokenTypes.IDENTIFIER)) elementAt = file.findElementAt(editor.getCaretModel().getOffset()); PyCallExpression callExpression = PsiTreeUtil.getParentOfType(elementAt, PyCallExpression.class);