From 1d08c79cffa6290bba4e02b74cd56464fd63c7cf Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sat, 15 Jun 2013 13:33:19 +0200 Subject: [PATCH] Check for non existing gate list while loading gates from disk. --- src/de/craftinc/gates/GatesManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/de/craftinc/gates/GatesManager.java b/src/de/craftinc/gates/GatesManager.java index 9683cb1..3582ccc 100644 --- a/src/de/craftinc/gates/GatesManager.java +++ b/src/de/craftinc/gates/GatesManager.java @@ -101,8 +101,12 @@ public class GatesManager this.gatesConfig = YamlConfiguration.loadConfiguration(gatesConfigFile); this.gates = (List)gatesConfig.getList(gatesPath); - - for (Object o : this.gates) { + + if (this.gates == null) { + this.gates = new ArrayList(); + } + + for (Object o : this.gates) { if (!(o instanceof Gate)) { Plugin.log(Level.SEVERE, "Gate file on disk is invalid. No gates loaded.");