1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

[207549] - fixed NumberFormat exception too

This commit is contained in:
Alena Laskavaia 2009-03-17 21:08:53 +00:00
parent 62474d01f8
commit 5b65560b4a

View file

@ -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;
}
}
}