Browse Source

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.
pull/2/head
zhukai 5 years ago committed by khadgarmage
parent
commit
bc68d9a039
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java

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

Loading…
Cancel
Save