Skip to content

Commit

Permalink
fix test failures where rootOfPath was unexpectedly null
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Aug 15, 2024
1 parent 5d279de commit 63c18ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SIL.LCModel/LinkedFilesRelativePathHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ private static string GetPathWithLowercaseRoot(string path)
try
{
var rootOfPath = Path.GetPathRoot(path);
// dotnet 8 on linux, when path contains invalid characters rootOfPath will be null
if (rootOfPath is null) return path.ToLowerInvariant();
return rootOfPath.ToLowerInvariant()
+ path.Substring(rootOfPath.Length, path.Length - rootOfPath.Length);
}
Expand Down

0 comments on commit 63c18ee

Please sign in to comment.