1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Adding guards against null message in Exception - bug #151663

This commit is contained in:
Norbert Pltt 2006-07-28 06:01:48 +00:00
parent c994a0e5aa
commit e1b13bbf23

View file

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