Check for non existing gate list while loading gates from disk.

This commit is contained in:
Tobias Ottenweller 2013-06-15 13:33:19 +02:00
parent cb0dec8b83
commit 1d08c79cff

View File

@ -102,7 +102,11 @@ public class GatesManager
this.gatesConfig = YamlConfiguration.loadConfiguration(gatesConfigFile);
this.gates = (List<Gate>)gatesConfig.getList(gatesPath);
for (Object o : this.gates) {
if (this.gates == null) {
this.gates = new ArrayList<Gate>();
}
for (Object o : this.gates) {
if (!(o instanceof Gate)) {
Plugin.log(Level.SEVERE, "Gate file on disk is invalid. No gates loaded.");