diff --git a/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java b/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java index c27db6783..2c6fcb0b8 100644 --- a/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java @@ -33,17 +33,16 @@ public class CleanBackupsTask extends BukkitRunnable { // Check files in backup folder from oldest to newest for (File file : BACKUP_DIR.listFiles()) { - if (!file.isFile()) { + if (!file.isFile() || file.isDirectory()) { continue; } amountTotal++; String fileName = file.getName(); - fileName = fileName.split("[.]")[0]; - Date date = getDate(fileName); + Date date = getDate(fileName.split("[.]")[0]); - if (date == null) { + if (!fileName.contains(".zip") || date == null) { mcMMO.p.debug("Could not determine date for file: " + fileName); continue; }