From 49341327b19da8e97c12194be2c162eae9916b40 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 30 Jan 2006 10:24:49 +0000 Subject: [PATCH] avoid NPE (125657) --- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 6d04fcd00..fcad1b42c 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -1357,7 +1357,7 @@ public class BcelShadow extends Shadow { LoadInstruction li = (LoadInstruction)searchPtr.getInstruction(); li.getIndex(); LocalVariableTag lvt = LazyMethodGen.getLocalVariableTag(searchPtr,li.getIndex()); - return lvt.getType(); + if (lvt!=null) return lvt.getType(); } // A field access instruction may tell us the real type of what the clone() call is on if (searchPtr.getInstruction() instanceof FieldInstruction) { @@ -1381,7 +1381,7 @@ public class BcelShadow extends Shadow { return BcelWorld.fromBcel(new ArrayType(Type.OBJECT,ana.getDimensions())); } throw new BCException("Can't determine real target of clone() when processing instruction "+ - searchPtr.getInstruction()); + searchPtr.getInstruction()+". Perhaps avoid selecting clone with your pointcut?"); } return tx; } -- 2.39.5