diff options
author | snowleo <schneeleo@gmail.com> | 2011-12-19 12:07:28 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-12-19 12:07:28 +0100 |
commit | cc0611721083e2cea902d6b8e7e819e7818680f5 (patch) | |
tree | efe4de80d80ae14e88d1af872c59d8ecc4a0050c | |
parent | cbd5b6c0f43a7be652c7ead7199939fadd6cc422 (diff) | |
parent | 5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca (diff) | |
download | Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar.gz Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar.lz Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar.xz Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.zip |
Merge branch 'refs/heads/master' into release
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Jails.java | 10 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java | 4 |
2 files changed, 12 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); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index bf5c11abe..1a7d27b4b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -20,6 +20,10 @@ public class Commandsetwarp extends EssentialsCommand { throw new NotEnoughArgumentsException(); } + + if (args[0].matches("[0-9]+")) { + throw new NotEnoughArgumentsException(); + } final Location loc = user.getLocation(); ess.getWarps().setWarp(args[0], loc); |