From 7fb9f8690c6ec7fe7864cfd79a4f2e45c8f2e6a1 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 4 Jun 2023 09:37:47 +0200 Subject: [PATCH] Add null check to AjLookupEnvironment.hasAspectDeclarations Fixes #240. Signed-off-by: Alexander Kriegisch --- .../ajdt/internal/compiler/lookup/AjLookupEnvironment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 6542ac828..e0123ee4a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -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; -- 2.39.5