From e1b13bbf23d0719e768900a4ddc0a3ec0d1cc38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Pl=F6tt?= Date: Fri, 28 Jul 2006 06:01:48 +0000 Subject: [PATCH] Adding guards against null message in Exception - bug #151663 --- .../src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java index e002e939033..6566ef61222 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java @@ -282,16 +282,18 @@ public class GDBCDIDebugger implements ICDIDebugger { String message = MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + exception.getMessage();//$NON-NLS-1$ int code = ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR; String ID = MIPlugin.getUniqueIdentifier(); + String exMessage = ((exception==null)||(exception.getLocalizedMessage()==null)) ? new String() : exception.getLocalizedMessage(); MultiStatus status = new MultiStatus(ID, code, message, exception); - status.add(new Status(IStatus.ERROR, ID, code, exception == null ? new String() : exception.getLocalizedMessage(), exception)); + status.add(new Status(IStatus.ERROR, ID, code, exMessage, exception)); return new CoreException(status); } protected CoreException newCoreException(String message, Throwable exception) { int code = ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR; String ID = MIPlugin.getUniqueIdentifier(); + String exMessage = ((exception==null)||(exception.getLocalizedMessage()==null)) ? new String() : exception.getLocalizedMessage(); MultiStatus status = new MultiStatus(ID, code, message, exception); - status.add(new Status(IStatus.ERROR, ID, code, exception == null ? new String() : exception.getLocalizedMessage(), exception)); + status.add(new Status(IStatus.ERROR, ID, code, exMessage, exception)); return new CoreException(status); }