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.

This commit is contained in:
Brettflan 2013-12-20 06:03:04 -06:00
parent 48fb41f0ee
commit 2e48a5f903
1 changed files with 15 additions and 0 deletions

View File

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