Fixed bug when trying to delete a file instead of a directory.

This commit is contained in:
CalDescent 2021-11-21 19:24:20 +00:00
parent c588786a06
commit 02eab89d82

View File

@ -222,7 +222,7 @@ public class ArbitraryDataCleanupManager extends Thread {
}
// If the directory is empty, we still need to delete its parent folder
if (contentsCount == 0 && tempDir.toFile().exists()) {
if (contentsCount == 0 && tempDir.toFile().isDirectory() && tempDir.toFile().exists()) {
try {
LOGGER.info("Parent directory {} is empty, so deleting it", tempDir);
FilesystemUtils.safeDeleteDirectory(tempDir, false);