1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

[Bug 457699] Fix NPE when renaming project and executable path LC

attribute is empty

Change-Id: I27405f759a0cdec1d66bc6bc63be0e7dbd183bf8
Signed-off-by: Teodor Madan <teodor.madan@freescale.com>
This commit is contained in:
Teodor Madan 2015-01-22 17:08:18 +02:00 committed by Gerrit Code Review @ Eclipse.org
parent bd247695cc
commit c00e25a8ad

View file

@ -127,11 +127,13 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
IPath pathProgName = new Path(launchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "")); //$NON-NLS-1$
String progExtension = pathProgName.getFileExtension();
String progName = pathProgName.removeFileExtension().lastSegment();
if (progName.equals(oldName)) {
pathProgName = pathProgName.removeLastSegments(1).append(newName).addFileExtension(progExtension);
}
copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
if (oldName.equals(progName)) {
pathProgName = pathProgName.removeLastSegments(1).append(newName);
if (progExtension != null )
pathProgName = pathProgName.addFileExtension(progExtension);
copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
pathProgName.toOSString());
}
try {
// Note: for non-local LCs, this will end up updating the .launch