From: aclement Date: Thu, 7 Apr 2005 10:04:13 +0000 (+0000) Subject: Guard against NPE X-Git-Tag: V1_5_0M2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c55a1db4b1eb66c0d8a59163d5e971703eaf59cb;p=aspectj.git Guard against NPE --- 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;