Bläddra i källkod

Fix a NPE which occured when there was no backups folder

TfT_02 11 år sedan
förälder
incheckning
cd470d5497

+ 4 - 0
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()) {