Skip to content

Commit 568b68b

Browse files
committed
Fix TranslationUnit.FileRelativeDirectory to be more robust against null include paths.
1 parent f5d4a5d commit 568b68b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AST/TranslationUnit.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ public string FileRelativeDirectory
6262
{
6363
get
6464
{
65-
if (fileRelativeDirectory != null) return fileRelativeDirectory;
65+
if (fileRelativeDirectory != null)
66+
return fileRelativeDirectory;
67+
68+
if (IncludePath == null)
69+
return string.Empty;
70+
6671
var path = IncludePath.Replace('\\', '/');
6772
var index = path.LastIndexOf('/');
6873
return fileRelativeDirectory = path.Substring(0, index);

0 commit comments

Comments
 (0)