diff options
author | wisberg <wisberg> | 2003-05-05 15:10:46 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-05-05 15:10:46 +0000 |
commit | d2cba1ffb6bfa8beedbd530fa0ec0e879da374ee (patch) | |
tree | ad5b5788d8e4db235dfae804e11fe2ba4ef82ba8 /asm | |
parent | 7d043c7a6303051f25f397b42c10fc42bfaccd9c (diff) | |
download | aspectj-d2cba1ffb6bfa8beedbd530fa0ec0e879da374ee.tar.gz aspectj-d2cba1ffb6bfa8beedbd530fa0ec0e879da374ee.zip |
NPE guard
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/org/aspectj/asm/StructureModelManager.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/asm/src/org/aspectj/asm/StructureModelManager.java b/asm/src/org/aspectj/asm/StructureModelManager.java index 4a868d9fe..1dbf2981d 100644 --- a/asm/src/org/aspectj/asm/StructureModelManager.java +++ b/asm/src/org/aspectj/asm/StructureModelManager.java @@ -16,7 +16,8 @@ package org.aspectj.asm; import java.util.*; import java.io.*; -import org.aspectj.asm.*; + +import org.aspectj.bridge.ISourceLocation; /** * @author Mik Kersten @@ -72,12 +73,15 @@ public class StructureModelManager { ProgramElementNode peNode = (ProgramElementNode)it.next(); List entries = new ArrayList(); entries.add(peNode); - Integer hash = new Integer(peNode.getSourceLocation().getLine()); - List existingEntry = (List)annotations.get(hash); - if (existingEntry != null) { - entries.addAll(existingEntry); + ISourceLocation sourceLoc = peNode.getSourceLocation(); + if (null != sourceLoc) { + Integer hash = new Integer(sourceLoc.getLine()); + List existingEntry = (List)annotations.get(hash); + if (existingEntry != null) { + entries.addAll(existingEntry); + } + annotations.put(hash, entries); } - annotations.put(hash, entries); } return annotations; } |