From 0548266d0fa452ad5e5a4eb4b9b1cc7b09008aee Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Mon, 15 May 2023 16:09:36 +0200 Subject: [PATCH] Check folder exist before trying to delete (#14249) Co-authored-by: Zeegaan --- .../Migrations/Upgrade/V_12_0_0/ResetCache.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs index ce105bf6b8..a3ec96ad7e 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs @@ -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())