Fix for empty input

`undefined` and `null` should be allowed because they should be checked by `validity.required`. This is so that you can validate an optional property and have it succeed if it is is not set.