The method checkEmail do not have null check (#1481)

When the email is empty , it wll be nullpointexception.

So i fix it with null check.
This commit is contained in:
zhukai 2019-12-16 01:10:05 +08:00 committed by khadgarmage
parent bfa3a36c92
commit bc68d9a039

View File

@ -53,6 +53,10 @@ public class CheckUtils {
* @return true if email regex valid, otherwise return false
*/
public static boolean checkEmail(String email) {
if (StringUtils.isEmpty(email)){
return false;
}
return email.length() > 5 && email.length() <= 40 && regexChecks(email, Constants.REGEX_MAIL_NAME) ;
}