diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-12-19 10:57:44 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-12-19 10:57:44 +0000 |
commit | 5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca (patch) | |
tree | efe4de80d80ae14e88d1af872c59d8ecc4a0050c | |
parent | 98cd03ac574b8d3fe5b6020fcc0f974f2a0d6539 (diff) | |
parent | 8761feb93f6dc0af2ee83f2eb7addcbc73e23cb8 (diff) | |
download | Essentials-5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca.tar Essentials-5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca.tar.gz Essentials-5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca.tar.lz Essentials-5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca.tar.xz Essentials-5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca.zip |
Merge branch 'master' of github.com:essentials/Essentials
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Jails.java | 10 |
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); } |