mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Removed an NPE when cancel was selected from browse dialog on path or file options
This commit is contained in:
parent
51a8ec8e42
commit
3a76c4f68c
1 changed files with 14 additions and 14 deletions
|
@ -492,24 +492,24 @@ public class FileListControl {
|
||||||
SelectPathInputDialog dialog = new SelectPathInputDialog(getListControl().getShell(), title, message, initVal, null, browseType);
|
SelectPathInputDialog dialog = new SelectPathInputDialog(getListControl().getShell(), title, message, initVal, null, browseType);
|
||||||
if (dialog.open() == SelectPathInputDialog.OK) {
|
if (dialog.open() == SelectPathInputDialog.OK) {
|
||||||
input = dialog.getValue();
|
input = dialog.getValue();
|
||||||
if (input == null || input.length() == 0) return ""; //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Double-quote the spaces in paths (if any)
|
// Double-quote the spaces in paths (if any)
|
||||||
switch (browseType) {
|
if (input != null && input.length() > 0) {
|
||||||
case IOption.BROWSE_DIR:
|
switch (browseType) {
|
||||||
case IOption.BROWSE_FILE:
|
case IOption.BROWSE_DIR:
|
||||||
String[] segments = input.split("\\s"); //$NON-NLS-1$
|
case IOption.BROWSE_FILE:
|
||||||
if (segments.length > 1) {
|
String[] segments = input.split("\\s"); //$NON-NLS-1$
|
||||||
// Double-quote paths with whitespaces
|
if (segments.length > 1) {
|
||||||
input = "\"" + input + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
// Double-quote paths with whitespaces
|
||||||
}
|
input = "\"" + input + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
break;
|
}
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue