Fixed NPE if using regionless config.

This commit is contained in:
zeeZ 2011-05-09 04:50:30 +02:00 committed by FrozenCow
parent cf1d6c414d
commit c0479bff05

View File

@ -86,8 +86,9 @@ class JsonTimerTask extends TimerTask {
//Handles Updates //Handles Updates
for (World world : this.server.getWorlds()) { for (World world : this.server.getWorlds()) {
//Parse region file for multi world style //Parse region file for multi world style
if(regions.getBoolean("useworldpath", false)) if (regions != null)
parseRegionFile(world.getName() + "/" + regions.getString("filename", "regions.yml"), regions.getString("filename", "regions.yml").replace(".", "_" + world.getName() + ".yml")); if (regions.getBoolean("useworldpath", false))
parseRegionFile(world.getName() + "/" + regions.getString("filename", "regions.yml"), regions.getString("filename", "regions.yml").replace(".", "_" + world.getName() + ".yml"));
current = System.currentTimeMillis(); current = System.currentTimeMillis();
@ -125,8 +126,9 @@ class JsonTimerTask extends TimerTask {
lastTimestamp = System.currentTimeMillis(); lastTimestamp = System.currentTimeMillis();
//Parse regions file for non worlds style //Parse regions file for non worlds style
if (!regions.getBoolean("useworldpath", false)) if (null != regions)
parseRegionFile(regions.getString("filename", "regions.yml"), regions.getString("filename", "regions.yml")); if (!regions.getBoolean("useworldpath", false))
parseRegionFile(regions.getString("filename", "regions.yml"), regions.getString("filename", "regions.yml"));
} }
//handles parsing and writing region json files //handles parsing and writing region json files