summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/Jail.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Jail.java b/Essentials/src/com/earth2me/essentials/Jail.java
index fdc184055..ff3bec2f7 100644
--- a/Essentials/src/com/earth2me/essentials/Jail.java
+++ b/Essentials/src/com/earth2me/essentials/Jail.java
@@ -31,7 +31,7 @@ public class Jail extends BlockListener implements IConf
public Location getJail(String jailName) throws Exception
{
- if (config.getProperty(jailName.toLowerCase()) == null)
+ if (jailName == null || config.getProperty(jailName.toLowerCase()) == null)
{
throw new Exception(Util.i18n("jailNotExist"));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
index 3312dafc0..5fafe3374 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
@@ -71,7 +71,7 @@ public class Commandtogglejail extends EssentialsCommand
return;
}
- if (args.length == 2 && p.isJailed() && !args[1].equalsIgnoreCase(p.getJail()))
+ if (args.length >= 2 && p.isJailed() && !args[1].equalsIgnoreCase(p.getJail()))
{
sender.sendMessage("§cPerson is already in jail " + p.getJail());
return;