From af4a9223c341f8b33fe32244cc281c6a72f1ff6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Engelthaler?= Date: Fri, 29 Jun 2018 12:57:17 +0200 Subject: [PATCH] Bug 536470: Fix NPE for includes outside workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I487823cf627680f61cf19d1228a84a3da68ce420 Signed-off-by: Jiří Engelthaler --- .../parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java | 3 +++ 1 file changed, 3 insertions(+) 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 b256f7aab65..b6657da2e16 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(); }