浏览代码

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.
zhukai 5 年之前
父节点
当前提交
bc68d9a039

+ 4 - 0
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
    */
   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) ;
   }