From c55a1db4b1eb66c0d8a59163d5e971703eaf59cb Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 7 Apr 2005 10:04:13 +0000 Subject: [PATCH] Guard against NPE --- .../org/aspectj/asm/internal/AspectJElementHierarchy.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java index ec48fdd5f..26bf3f4b0 100644 --- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java +++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java @@ -136,7 +136,10 @@ public class AspectJElementHierarchy implements IHierarchy { if (packageName == null) { packageNode = root; } else { - for (Iterator it = root.getChildren().iterator(); it.hasNext(); ) { + if (root == null) return null; + List kids = root.getChildren(); + if (kids == null) return null; + for (Iterator it = kids.iterator(); it.hasNext(); ) { IProgramElement node = (IProgramElement)it.next(); if (packageName.equals(node.getName())) { packageNode = node; -- 2.39.5