Skip to content

Commit

Permalink
Add directory existence check before deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
philgei committed Dec 7, 2023
1 parent fafafde commit e533745
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions AdLerBackend.Infrastructure/Storage/StorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit e533745

Please sign in to comment.