Skip to content

Commit 1fd5c87

Browse files
committed
Simplify EnsureCreationOfDirectory()
DirectoryInfo.Create() already contains a check for directory existence on PInvoke level.
1 parent 2956ebf commit 1fd5c87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

CollapseLauncher/Classes/Helper/StreamUtility/StreamExtension.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ internal static FileInfo EnsureCreationOfDirectory(this FileInfo filePath)
142142

143143
try
144144
{
145-
if (directoryInfo is { Exists: false })
146-
directoryInfo.Create();
147-
145+
directoryInfo?.Create();
148146
return filePath;
149147
}
150148
finally

0 commit comments

Comments
 (0)