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;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.validation.Errors;
|
||||
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
|
||||
final Matcher m = emailPattern.matcher(email);
|
||||
|
||||
//check whether match is found
|
||||
return m.matches();
|
||||
//check whether match is found
|
||||
result = m.matches();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user