]> source.dussan.org Git - aspectj.git/commitdiff
Add null check to AjLookupEnvironment.hasAspectDeclarations
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 4 Jun 2023 07:37:47 +0000 (09:37 +0200)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 4 Jun 2023 08:22:22 +0000 (15:22 +0700)
Fixes #240.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java

index 6542ac8285377badfd4770e3817d7e1f46871a61..e0123ee4ac36da866508a69ec4382917ce3e2823 100644 (file)
@@ -1472,6 +1472,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
   }
 
   private static boolean hasAspectDeclarations(CompilationUnitDeclaration unit) {
+    if (unit.types == null)
+      return false;
     for (int j = 0; j < unit.types.length; j++) {
       if (unit.types[j] instanceof AspectDeclaration) {
         return true;