summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/Jails.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java
index 4c1090c5c..f8ab2d02e 100644
--- a/Essentials/src/com/earth2me/essentials/Jails.java
+++ b/Essentials/src/com/earth2me/essentials/Jails.java
@@ -59,7 +59,12 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
{
throw new Exception(_("jailNotExist"));
}
- return getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
+ Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
+ if (loc == null || loc.getWorld() == null)
+ {
+ throw new Exception(_("jailNotExist"));
+ }
+ return loc;
}
finally
{
@@ -111,7 +116,8 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
{
if (!(user.getBase() instanceof OfflinePlayer))
{
- user.getTeleport().now(getJail(jail), false, TeleportCause.COMMAND);
+ Location loc = getJail(jail);
+ user.getTeleport().now(loc, false, TeleportCause.COMMAND);
}
user.setJail(jail);
}