Demand 'true' or 'false'. Don't allow "fsdfgsd" to be treated as false anymore.

This commit is contained in:
libraryaddict 2014-09-15 01:55:38 +12:00
parent a34ede1104
commit 17822426ab

View File

@ -573,14 +573,15 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
} }
} }
if (value == null && boolean.class == param) { if (value == null && boolean.class == param) {
// Parse to boolean if (valueString == null) {
if (valueString == null
|| !("true".equalsIgnoreCase(valueString) || "false".equalsIgnoreCase(valueString))) {
value = true; value = true;
i--; i--;
} else { } else if (valueString.equalsIgnoreCase("true")) {
value = "true".equalsIgnoreCase(valueString); value = true;
} } else if (valueString.equalsIgnoreCase("false")) {
value = false;
} else
throw parseToException("true/false", valueString, methodName);
} }
if (value != null) { if (value != null) {
break; break;