Demand 'true' or 'false'. Don't allow "fsdfgsd" to be treated as false anymore.
This commit is contained in:
parent
a34ede1104
commit
17822426ab
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user