From: Alexander Kriegisch Date: Sun, 4 Jun 2023 07:37:47 +0000 (+0200) Subject: Add null check to AjLookupEnvironment.hasAspectDeclarations X-Git-Tag: V1_9_20~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7fb9f8690c6ec7fe7864cfd79a4f2e45c8f2e6a1;p=aspectj.git Add null check to AjLookupEnvironment.hasAspectDeclarations Fixes #240. Signed-off-by: Alexander Kriegisch --- 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;