diff --git a/src/main/java/me/libraryaddict/disguise/utilities/parser/params/ParamInfo.java b/src/main/java/me/libraryaddict/disguise/utilities/parser/params/ParamInfo.java index 8323fad3..40971b2e 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/parser/params/ParamInfo.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/parser/params/ParamInfo.java @@ -47,12 +47,12 @@ public abstract class ParamInfo { } } - public ParamInfo(Class paramClass, String name, String description, Map possibleValues) { + public ParamInfo(Class paramClass, String name, String description, Map possibleValues) { this(paramClass, name, name, description, possibleValues); } public ParamInfo(Class paramClass, String name, String descriptiveName, String description, - Map possibleValues) { + Map possibleValues) { this(paramClass, name, descriptiveName, description); this.possibleValues = new HashMap<>(); @@ -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;