1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 536470: Fix NPE for includes outside workspace

Change-Id: I487823cf627680f61cf19d1228a84a3da68ce420
Signed-off-by: Jiří Engelthaler <engycz@gmail.com>
This commit is contained in:
Jiří Engelthaler 2018-06-29 12:57:17 +02:00
parent 9eb262a192
commit af4a9223c3

View file

@ -1034,6 +1034,9 @@ public class ASTTypeUtil {
} }
IPath path = new Path(filename); IPath path = new Path(filename);
IFile file = ResourceLookup.selectFileForLocation(path, cproject.getProject()); IFile file = ResourceLookup.selectFileForLocation(path, cproject.getProject());
if (file == null) {
return filename;
}
IPath workspaceRelative = file.getFullPath(); IPath workspaceRelative = file.getFullPath();
return workspaceRelative.toString(); return workspaceRelative.toString();
} }