diff --git a/LearningHub.Nhs.WebUI/Services/FileService.cs b/LearningHub.Nhs.WebUI/Services/FileService.cs index 0e6fce092..4e02db124 100644 --- a/LearningHub.Nhs.WebUI/Services/FileService.cs +++ b/LearningHub.Nhs.WebUI/Services/FileService.cs @@ -309,7 +309,7 @@ private async Task MoveOutPutDirectoryToArchive(List allDirectoryRef) } } - await directory.DeleteAsync(); + await directory.DeleteIfExistsAsync(); } } } @@ -365,6 +365,8 @@ private async Task DeleteSubdirectory(string pathDirectory) await sourceFileClient.DeleteIfExistsAsync(); } } + + await sourceDirectory.DeleteIfExistsAsync(); } private async Task MoveInPutDirectoryToArchive(List allDirectoryRef)