Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJiří Engelthaler2018-06-29 06:57:17 -0400
committerJiří Engelthaler2018-06-29 07:07:59 -0400
commitaf4a9223c341f8b33fe32244cc281c6a72f1ff6e (patch)
treeddd79f76189aadb2a7b6583aa5ab351396a88c34 /core
parent9eb262a1922ecb631e8f67f328b814bdde275ac3 (diff)
downloadorg.eclipse.cdt-af4a9223c341f8b33fe32244cc281c6a72f1ff6e.tar.gz
org.eclipse.cdt-af4a9223c341f8b33fe32244cc281c6a72f1ff6e.tar.xz
org.eclipse.cdt-af4a9223c341f8b33fe32244cc281c6a72f1ff6e.zip
Bug 536470: Fix NPE for includes outside workspace
Change-Id: I487823cf627680f61cf19d1228a84a3da68ce420 Signed-off-by: Jiří Engelthaler <engycz@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
index b256f7aab6..b6657da2e1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
@@ -1034,6 +1034,9 @@ public class ASTTypeUtil {
}
IPath path = new Path(filename);
IFile file = ResourceLookup.selectFileForLocation(path, cproject.getProject());
+ if (file == null) {
+ return filename;
+ }
IPath workspaceRelative = file.getFullPath();
return workspaceRelative.toString();
}

Back to the top