From 2e48a5f903b087256991892131f0417f0f09a31d Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 20 Dec 2013 06:03:04 -0600 Subject: [PATCH] Additional check added to make sure frequency value specified in Fill and Trim commands is greater than zero. Thanks to sync667 for pointing this oversight out. --- .../java/com/wimbli/WorldBorder/WBCommand.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/wimbli/WorldBorder/WBCommand.java b/src/main/java/com/wimbli/WorldBorder/WBCommand.java index 64bc715..fd31829 100644 --- a/src/main/java/com/wimbli/WorldBorder/WBCommand.java +++ b/src/main/java/com/wimbli/WorldBorder/WBCommand.java @@ -1005,8 +1005,16 @@ public class WBCommand implements CommandExecutor catch(NumberFormatException ex) { sender.sendMessage(clrErr + "The frequency and padding values must be integers."); + fillDefaults(); return false; } + if (fillFrequency <= 0) + { + sender.sendMessage(clrErr + "The frequency value must be greater than zero."); + fillDefaults(); + return false; + } + if (!forceLoad.isEmpty()) fillForceLoad = strAsBool(forceLoad); @@ -1111,6 +1119,13 @@ public class WBCommand implements CommandExecutor catch(NumberFormatException ex) { sender.sendMessage(clrErr + "The frequency and padding values must be integers."); + trimDefaults(); + return false; + } + if (trimFrequency <= 0) + { + sender.sendMessage(clrErr + "The frequency value must be greater than zero."); + trimDefaults(); return false; }