From bdbc9cc5dba81d2ac3d1bfb88e2b65288a0df5c0 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 6 Sep 2012 18:11:19 +0400 Subject: [PATCH] npe fix --- .../codeInsight/intentions/SpecifyTypeInDocstringIntention.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);