Check for non existing gate list while loading gates from disk.
This commit is contained in:
parent
cb0dec8b83
commit
1d08c79cff
@ -101,8 +101,12 @@ public class GatesManager
|
|||||||
|
|
||||||
this.gatesConfig = YamlConfiguration.loadConfiguration(gatesConfigFile);
|
this.gatesConfig = YamlConfiguration.loadConfiguration(gatesConfigFile);
|
||||||
this.gates = (List<Gate>)gatesConfig.getList(gatesPath);
|
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)) {
|
if (!(o instanceof Gate)) {
|
||||||
Plugin.log(Level.SEVERE, "Gate file on disk is invalid. No gates loaded.");
|
Plugin.log(Level.SEVERE, "Gate file on disk is invalid. No gates loaded.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user