1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 309032: Fixed NPE I'm seeing intermittently during session shutdown.

This commit is contained in:
John Cortell 2010-05-13 22:15:23 +00:00
parent 5a1558ddd2
commit ca94f732f9

View file

@ -151,9 +151,15 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
* *
* @param expression * @param expression
* @return * @return
* @throws DebugException if target not available
*/ */
private BigInteger evaluateLiteralAddress(String addr) { private BigInteger evaluateLiteralAddress(String addr) throws DebugException {
IAddressFactory addrFactory = getDebugTarget().getAddressFactory(); CDebugTarget target = getDebugTarget();
if (target == null) {
throw new DebugException(new Status(IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED,
InternalDebugCoreMessages.getString("CMemoryBlockRetrievalExtension.CDebugTarget_not_available"), null)); //$NON-NLS-1$
}
IAddressFactory addrFactory = target.getAddressFactory();
if (addrFactory instanceof IAddressFactory2) { if (addrFactory instanceof IAddressFactory2) {
return ((IAddressFactory2)addrFactory).createAddress(addr, false).getValue(); return ((IAddressFactory2)addrFactory).createAddress(addr, false).getValue();
} }