From 5e10c6fe87d2a738b850844aa4248b83866b1c7a Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Tue, 24 Apr 2012 16:51:23 -0400 Subject: [PATCH] crash-- --- src/main/java/us/camin/regions/RegionCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/us/camin/regions/RegionCommand.java b/src/main/java/us/camin/regions/RegionCommand.java index c20c22b..2250d1f 100644 --- a/src/main/java/us/camin/regions/RegionCommand.java +++ b/src/main/java/us/camin/regions/RegionCommand.java @@ -77,8 +77,12 @@ public class RegionCommand implements CommandExecutor { p.sendMessage("City region set to "+r.name()); } else if (subCommand.equals("regen") && p.hasPermission("regions.create")) { Region r = m_plugin.regionManager().nearestRegion(p.getLocation()); - m_plugin.regenRegionPost(r); - p.sendMessage("Region post regenerated."); + if (r == null) { + p.sendMessage("There are no regions in this world."); + } else { + m_plugin.regenRegionPost(r); + p.sendMessage("Region post regenerated."); + } } else { p.sendMessage("Unknown operation. Options are create, remove, city."); }