mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-11 11:40:29 +00:00
If null is unexpected, throw error to more accurately inform player of malformed parameters
This commit is contained in:
parent
4467075a35
commit
815b6f4c2f
1 changed files with 7 additions and 2 deletions
|
@ -83,6 +83,11 @@ public abstract class ParamInfo {
|
|||
|
||||
Object value = fromString(string);
|
||||
|
||||
// Throw error if null wasn't expected
|
||||
if (value == null && !canReturnNull()) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
arguments.remove(0);
|
||||
|
||||
return value;
|
||||
|
|
Loading…
Reference in a new issue