diff --git a/zero/FileStorage/PhysicalFileSystem.cs b/zero/FileStorage/PhysicalFileSystem.cs index c5b3cf33..4248c828 100644 --- a/zero/FileStorage/PhysicalFileSystem.cs +++ b/zero/FileStorage/PhysicalFileSystem.cs @@ -119,6 +119,12 @@ public class PhysicalFileSystem : IFileSystem try { string resolvedPath = ResolvePath(path); + + if (!File.Exists(resolvedPath)) + { + return Task.CompletedTask; + } + File.Delete(resolvedPath); return Task.CompletedTask; } @@ -256,6 +262,12 @@ public class PhysicalFileSystem : IFileSystem try { string resolvedPath = ResolvePath(path); + + if (!Directory.Exists(resolvedPath)) + { + return Task.CompletedTask; + } + Directory.Delete(resolvedPath, recursive); return Task.CompletedTask; }