mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-20 15:35:24 +02: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$
|
IPath pathProgName = new Path(launchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "")); //$NON-NLS-1$
|
||||||
String progExtension = pathProgName.getFileExtension();
|
String progExtension = pathProgName.getFileExtension();
|
||||||
String progName = pathProgName.removeFileExtension().lastSegment();
|
String progName = pathProgName.removeFileExtension().lastSegment();
|
||||||
if (progName.equals(oldName)) {
|
if (oldName.equals(progName)) {
|
||||||
pathProgName = pathProgName.removeLastSegments(1).append(newName).addFileExtension(progExtension);
|
pathProgName = pathProgName.removeLastSegments(1).append(newName);
|
||||||
}
|
if (progExtension != null )
|
||||||
|
pathProgName = pathProgName.addFileExtension(progExtension);
|
||||||
copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
||||||
pathProgName.toOSString());
|
pathProgName.toOSString());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Note: for non-local LCs, this will end up updating the .launch
|
// Note: for non-local LCs, this will end up updating the .launch
|
||||||
|
|
Loading…
Add table
Reference in a new issue