From a27596bcfbf326fe95f924c3a98ccec90d11bc84 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Tue, 24 Dec 2013 19:42:12 -0600 Subject: [PATCH] If they provide an incorrect format in time, don't override it. --- .../jail/command/commands/JailCommand.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java b/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java index 588a795..cea843e 100644 --- a/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java +++ b/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java @@ -74,14 +74,14 @@ public class JailCommand implements Command { //Trying out the time. Long time = 10L; try { - time = Util.getTime(params.time()); - }catch(Exception e) { - try { - time = Util.getTime(jm.getPlugin().getConfig().getString(Settings.JAILDEFAULTTIME.getPath(), "10m")); - }catch(Exception e2) { - sender.sendMessage(ChatColor.RED + "Number format is incorrect."); - return true; + if(params.time().isEmpty()) { + time = Util.getTime(jm.getPlugin().getConfig().getString(Settings.JAILDEFAULTTIME.getPath(), "30m")); + }else { + time = Util.getTime(params.time()); } + }catch(Exception e) { + sender.sendMessage(ChatColor.RED + "Number format is incorrect."); + return true; } Jail j = jm.getJail(params.jail());