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:
parent
bd247695cc
commit
c00e25a8ad
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue