diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 7d7aae780..e018832d0 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -59,7 +59,16 @@ public class Kit final Calendar time = new GregorianCalendar(); // Take the current time, and remove the delay from it. - final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0.0d; + double delay = 0; + try + { + // Also make sure delay is valid + delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0.0d; + } + catch (Exception e) + { + throw new Exception(_("kitError2")); + } final Calendar earliestTime = new GregorianCalendar(); earliestTime.add(Calendar.SECOND, -(int)delay); earliestTime.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));