IDEA-136567 Groovy: fix NPE in compilation unit

This commit is contained in:
Max Medvedev
2015-02-15 23:07:41 +03:00
parent 2e9b39674b
commit aecbbea7a3
@@ -248,7 +248,10 @@ public class GroovyCompilerWrapper {
return ((ClassNode)node).getModule();
}
if (node instanceof AnnotatedNode) {
return ((AnnotatedNode)node).getDeclaringClass().getModule();
ClassNode declaringClass = ((AnnotatedNode)node).getDeclaringClass();
if (declaringClass != null) {
return declaringClass.getModule();
}
}
return null;
}