If null is unexpected, throw error to more accurately inform player of malformed parameters
This commit is contained in:
parent
4467075a35
commit
815b6f4c2f
@ -83,6 +83,11 @@ public abstract class ParamInfo {
|
|||||||
|
|
||||||
Object value = fromString(string);
|
Object value = fromString(string);
|
||||||
|
|
||||||
|
// Throw error if null wasn't expected
|
||||||
|
if (value == null && !canReturnNull()) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
|
||||||
arguments.remove(0);
|
arguments.remove(0);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
Reference in New Issue
Block a user