From e5337457c33e1621abcd0184f1d604b0981521e3 Mon Sep 17 00:00:00 2001 From: philgei Date: Thu, 7 Dec 2023 11:17:03 +0100 Subject: [PATCH] Add directory existence check before deletion --- AdLerBackend.Infrastructure/Storage/StorageService.cs | 1 + README.MD | 2 ++ 2 files changed, 3 insertions(+) diff --git a/AdLerBackend.Infrastructure/Storage/StorageService.cs b/AdLerBackend.Infrastructure/Storage/StorageService.cs index 89085491..5b323c72 100644 --- a/AdLerBackend.Infrastructure/Storage/StorageService.cs +++ b/AdLerBackend.Infrastructure/Storage/StorageService.cs @@ -43,6 +43,7 @@ public bool DeleteWorld(WorldDeleteDto worldToDelete) { var workingDir = _fileSystem.Path.Join("wwwroot", "courses", worldToDelete.WorldInstanceId.ToString()); + if (!_fileSystem.Directory.Exists(workingDir)) return true; _fileSystem.Directory.Delete(workingDir, true); return true; } diff --git a/README.MD b/README.MD index 7edbf558..786c1b06 100644 --- a/README.MD +++ b/README.MD @@ -38,5 +38,7 @@ Das AdLer-Backend bietet einen Health-Check-Endpoint an, der zur Überwachung de | Backend Version | [AMG Version](https://github.com/ProjektAdLer/Autorentool) | [Moodle-Plugin Version](https://github.com/Glutamat42/moodle-docker) | |-----------------|-----------------|---------------------------| | 2.0.0 | 2.x | 2.x | +| 2.0.1 | 2.x | 2.x | +| 2.0.2 | 2.x | 2.x | Zu jeden neuen Release wird diese Tabelle aktualisiert.