mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
- Fix java.lang.NullPointerException,at java.util.regex.Matcher.getTextLength(Matcher.java:1140) exception.
This commit is contained in:
parent
d811c8f011
commit
1e53ba827f
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.wisemapping.validator;
|
package com.wisemapping.validator;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.springframework.validation.Errors;
|
import org.springframework.validation.Errors;
|
||||||
import org.springframework.validation.ValidationUtils;
|
import org.springframework.validation.ValidationUtils;
|
||||||
|
|
||||||
@ -44,12 +45,15 @@ final public class Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean isValidateEmailAddress(final String email) {
|
static boolean isValidateEmailAddress(@Nullable final String email) {
|
||||||
|
boolean result = false;
|
||||||
|
if (email != null) {
|
||||||
|
//Match the given string with the emailPattern
|
||||||
|
final Matcher m = emailPattern.matcher(email);
|
||||||
|
|
||||||
//Match the given string with the emailPattern
|
//check whether match is found
|
||||||
final Matcher m = emailPattern.matcher(email);
|
result = m.matches();
|
||||||
|
}
|
||||||
//check whether match is found
|
return result;
|
||||||
return m.matches();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user