Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit cde2546

Browse files
committed
treat null path as "" in CombineWith
1 parent 6779d17 commit cde2546

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ServiceStack.Text/PathUtils.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ public static string AssertDir(this string dirPath)
8484

8585
public static string CombineWith(this string path, params string[] thesePaths)
8686
{
87+
if (path == null)
88+
path = "";
89+
8790
if (thesePaths.Length == 1 && thesePaths[0] == null) return path;
8891
var startPath = path.Length > 1 ? path.TrimEnd('/', '\\') : path;
8992
return CombinePaths(new StringBuilder(startPath), thesePaths);

0 commit comments

Comments
 (0)