If null is unexpected, throw error to more accurately inform player of malformed parameters

This commit is contained in:
libraryaddict 2018-10-24 10:10:35 +13:00
parent 4467075a35
commit 815b6f4c2f

View File

@ -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;