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