From 17822426ab578a8673ca983a75bca891e751c2d0 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 15 Sep 2014 01:55:38 +1200 Subject: [PATCH] Demand 'true' or 'false'. Don't allow "fsdfgsd" to be treated as false anymore. --- .../disguise/utilities/BaseDisguiseCommand.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java index 6d019b8b..a0cfb10c 100644 --- a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java @@ -573,14 +573,15 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { } } if (value == null && boolean.class == param) { - // Parse to boolean - if (valueString == null - || !("true".equalsIgnoreCase(valueString) || "false".equalsIgnoreCase(valueString))) { + if (valueString == null) { value = true; i--; - } else { - value = "true".equalsIgnoreCase(valueString); - } + } else if (valueString.equalsIgnoreCase("true")) { + value = true; + } else if (valueString.equalsIgnoreCase("false")) { + value = false; + } else + throw parseToException("true/false", valueString, methodName); } if (value != null) { break;