From 5fead14cc49e9e433fbd839a36f2114a45615d48 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 7 Apr 2011 19:56:50 +0200 Subject: [PATCH] NPE --- .../codeInspection/emptyMethod/EmptyMethodInspection.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java b/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java index 9a9f1a73f749..35aeedc78c66 100644 --- a/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java @@ -158,7 +158,11 @@ public class EmptyMethodInspection extends GlobalJavaInspectionTool { if (!refMethod.isBodyEmpty()) { return false; } - if (AnnotationUtil.isAnnotated(refMethod.getElement(), EXCLUDE_ANNOS)) { + final PsiModifierListOwner owner = refMethod.getElement(); + if (owner == null) { + return false; + } + if (AnnotationUtil.isAnnotated(owner, EXCLUDE_ANNOS)) { return false; } for (final Object extension : Extensions.getExtensions(ExtensionPoints.EMPTY_METHOD_TOOL)) {