If they provide an incorrect format in time, don't override it.

This commit is contained in:
graywolf336 2013-12-24 19:42:12 -06:00
parent 978bd044fe
commit a27596bcfb

View File

@ -74,14 +74,14 @@ public class JailCommand implements Command {
//Trying out the time. //Trying out the time.
Long time = 10L; Long time = 10L;
try { try {
time = Util.getTime(params.time()); if(params.time().isEmpty()) {
}catch(Exception e) { time = Util.getTime(jm.getPlugin().getConfig().getString(Settings.JAILDEFAULTTIME.getPath(), "30m"));
try { }else {
time = Util.getTime(jm.getPlugin().getConfig().getString(Settings.JAILDEFAULTTIME.getPath(), "10m")); time = Util.getTime(params.time());
}catch(Exception e2) {
sender.sendMessage(ChatColor.RED + "Number format is incorrect.");
return true;
} }
}catch(Exception e) {
sender.sendMessage(ChatColor.RED + "Number format is incorrect.");
return true;
} }
Jail j = jm.getJail(params.jail()); Jail j = jm.getJail(params.jail());