Skip to content

Commit a11962e

Browse files
committed
chore(validators): validate email if value is null
1 parent c66e5b1 commit a11962e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/form_builder_validators/lib/src/form_builder_validators.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class FormBuilderValidators {
151151
String? errorText,
152152
}) =>
153153
(valueCandidate) =>
154-
true == valueCandidate?.isNotEmpty && !isEmail(valueCandidate ?? '')
154+
(valueCandidate?.isNotEmpty ?? false) && !isEmail(valueCandidate!)
155155
? errorText ?? FormBuilderLocalizations.current.emailErrorText
156156
: null;
157157

0 commit comments

Comments
 (0)