Check folder exist before trying to delete (#14249)

Co-authored-by: Zeegaan <nge@umbraco.dk>
This commit is contained in:
Nikolaj Geisle
2023-05-15 16:09:36 +02:00
committed by GitHub
parent 27e5b55e05
commit 0548266d0f

View File

@@ -22,6 +22,11 @@ public class ResetCache : MigrationBase
private void DeleteAllFilesInFolder(string path)
{
if (Directory.Exists(path) == false)
{
return;
}
var directoryInfo = new DirectoryInfo(path);
foreach (FileInfo file in directoryInfo.GetFiles())