Modify a validate() method to use is_null() rather than empty() because the latter provides a false positive.