Skip to content

Commit 5e4d403

Browse files
committed
fixed CreateDirectoryIfVoid method
1 parent 916b91d commit 5e4d403

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Runtime/Directory.Extensions.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
public static class DirectoryExtensions
1010
{
1111
/// <summary> Creates a directory if it doesn't exist. </summary>
12-
public static void CreateDirectoryIfVoid(this string path) => path.DirectoryExists()?.CreateDirectory();
12+
public static void CreateDirectoryIfVoid(this string path)
13+
{
14+
if (path.DirectoryExists() == null)
15+
{
16+
path.CreateDirectory();
17+
}
18+
}
1319

1420
/// Returns the directory path if it exists, otherwise returns null.
1521
/// Used for null checking

0 commit comments

Comments
 (0)