From 5b65560b4a7f39570b11728988ca502e71db2887 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 17 Mar 2009 21:08:53 +0000 Subject: [PATCH] [207549] - fixed NumberFormat exception too --- .../cdt/debug/mi/core/cdi/model/type/ArrayValue.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java index 79ee5e924b7..b9ff2d589b6 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java @@ -44,7 +44,7 @@ public class ArrayValue extends DerivedValue implements ICDIArrayValue, ICDIPoin public ArrayValue(Variable v, String hexAddress) { super(v); if (hexAddress == null || hexAddress.trim().length()==0) { - this.hexAddress = "0"; + return; } else if (hexAddress.startsWith("0x") || hexAddress.startsWith("0X")) { this.hexAddress = hexAddress.substring(2); } else { @@ -102,6 +102,12 @@ public class ArrayValue extends DerivedValue implements ICDIArrayValue, ICDIPoin * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue() */ public BigInteger pointerValue() throws CDIException { - return new BigInteger(hexAddress, 16); + if (hexAddress == null) + return null; + try { + return new BigInteger(hexAddress, 16); + } catch (NumberFormatException e) { + return null; + } } }