diff options
-rw-r--r-- | image_manager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/image_manager.cpp b/image_manager.cpp index 4a27260..69df9dd 100644 --- a/image_manager.cpp +++ b/image_manager.cpp @@ -38,7 +38,16 @@ struct RemovablePath RemovablePath(const fs::path& path) : path(path) {} ~RemovablePath() { - fs::remove_all(path); + if (fs::exists(path)) + { + fs::remove_all(path); + } + else + { + // Path should exist + log<level::ERR>("Error removable path does not exist", + entry("PATH=%s", path.c_str())); + } } }; |