Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2015-01-15 15:16:48 +0000
committerElena Laskavaia2015-01-15 21:48:56 +0000
commita0fd70a09e044b451ee3d51f893600732b3e2c1a (patch)
treea6e0cc60e18f6d87cfbbc12fc24377643a9126c4
parentb26f160e3b56f3786e22b9e7375561cde7113369 (diff)
downloadorg.eclipse.cdt-a0fd70a09e044b451ee3d51f893600732b3e2c1a.tar.gz
org.eclipse.cdt-a0fd70a09e044b451ee3d51f893600732b3e2c1a.tar.xz
org.eclipse.cdt-a0fd70a09e044b451ee3d51f893600732b3e2c1a.zip
Bug 457590 - Workspace... button does not work in Library Path picker
Change-Id: Idcb597b5d60494438b1a5f29f4efad00050acc06 Reviewed-on: https://git.eclipse.org/r/39671 Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com> Tested-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
-rw-r--r--core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java
index 9b14233dd41..946dc31eccb 100644
--- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java
+++ b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java
@@ -238,7 +238,7 @@ public class FileListControl {
/* See if we can discover the project from the context *
* and check whether the path must be resolved... */
IProject project = null;
- IResource resource = null;
+
if(contextInfo != null) {
try {
// Try to find the project
@@ -262,9 +262,15 @@ public class FileListControl {
// ignore
}
}
+ IResource resource = null;
if (!currentPathText.isEmpty()) {
- IResource rs[] = ResourcesPlugin.getWorkspace().getRoot()
- .findContainersForLocationURI(URIUtil.toURI(currentPathText));
+ IResource rs[] = null;
+ try {
+ rs = ResourcesPlugin.getWorkspace().getRoot()
+ .findContainersForLocationURI(URIUtil.toURI(currentPathText));
+ } catch (Exception e) {
+ // rs will be null here, exception is throw is path is not absolute
+ }
if (rs == null || rs.length == 0)
resource = ResourceLookup.selectFileForLocation(new Path(currentPathText),
null);

Back to the top