aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2023-06-04 09:37:47 +0200
committerAlexander Kriegisch <Alexander@Kriegisch.name>2023-06-04 15:22:22 +0700
commit7fb9f8690c6ec7fe7864cfd79a4f2e45c8f2e6a1 (patch)
tree4fcf7d2b7b997e0789d1873848a8b364e3bd2132
parenta8a2f82fda825b36acade534f876f595b6566919 (diff)
downloadaspectj-7fb9f8690c6ec7fe7864cfd79a4f2e45c8f2e6a1.tar.gz
aspectj-7fb9f8690c6ec7fe7864cfd79a4f2e45c8f2e6a1.zip
Add null check to AjLookupEnvironment.hasAspectDeclarations
Fixes #240. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java2
1 files changed, 2 insertions, 0 deletions
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;