From cd470d5497d12d842e0666817ff49782dfabec51 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sun, 3 Nov 2013 14:09:41 +0100 Subject: [PATCH] Fix a NPE which occured when there was no backups folder --- .../com/gmail/nossr50/runnables/backups/CleanBackupsTask.java | 4 ++++ 1 file changed, 4 insertions(+) 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 5011bc23d..03ce91443 100644 --- a/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java @@ -26,6 +26,10 @@ public class CleanBackupsTask extends BukkitRunnable { int amountTotal = 0; int amountDeleted = 0; + if (BACKUP_DIR.listFiles() == null) { + return; + } + // Check files in backup folder from oldest to newest for (File file : BACKUP_DIR.listFiles()) { if (!file.isFile()) {