Fixes to jail

This commit is contained in:
snowleo 2011-08-08 16:42:56 +02:00
parent ca3369938d
commit 69d3921a6a
2 changed files with 2 additions and 2 deletions

View file

@ -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"));
}

View file

@ -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;