From 58df3a8441c0321d71b77befdd9ff0efdda3b477 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 31 Jul 2011 11:14:36 -0500 Subject: [PATCH] Fix trap when bad basenode in region component --- src/main/java/org/dynmap/regions/RegionHandler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/dynmap/regions/RegionHandler.java b/src/main/java/org/dynmap/regions/RegionHandler.java index 01ecd248..0875afcf 100644 --- a/src/main/java/org/dynmap/regions/RegionHandler.java +++ b/src/main/java/org/dynmap/regions/RegionHandler.java @@ -11,6 +11,7 @@ import java.util.HashSet; import java.util.logging.Level; import org.bukkit.util.config.Configuration; import org.dynmap.ConfigurationNode; +import org.dynmap.Log; import org.dynmap.web.HttpRequest; import org.dynmap.web.HttpResponse; import org.dynmap.web.Json; @@ -62,7 +63,12 @@ public class RegionHandler extends FileHandler { return null; regionConfig.load(); /* Parse region data and store in MemoryInputStream */ - Map regionData = (Map) regionConfig.getProperty(regions.getString("basenode", "regions")); + String bnode = regions.getString("basenode", "regions"); + Map regionData = (Map) regionConfig.getProperty(bnode); + if(regionData == null) { + Log.severe("Region data from " + infile.getPath() + " does not include basenode '" + bnode + "'"); + return null; + } /* See if we have explicit list of regions to report - limit to this list if we do */ List idlist = regions.getStrings("visibleregions", null); if(idlist != null) {