If null is unexpected, throw error to more accurately inform player of malformed parameters
This commit is contained in:
		| @@ -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; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user