File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -622,17 +622,20 @@ class FormBuilderValidators {
622
622
String ? errorText,
623
623
}) {
624
624
return (T ? valueCandidate) {
625
- assert (valueCandidate is num || valueCandidate is String );
626
- final number = valueCandidate is num
627
- ? valueCandidate
628
- : num .tryParse (valueCandidate.toString ());
625
+ if (valueCandidate != null ) {
626
+ assert (valueCandidate is num || valueCandidate is String );
627
+ final number = valueCandidate is num
628
+ ? valueCandidate
629
+ : num .tryParse (valueCandidate.toString ());
629
630
630
- final minResult =
631
- min (minValue, inclusive: inclusive, errorText: errorText)(number);
632
- final maxResult =
633
- max (maxValue, inclusive: inclusive, errorText: errorText)(number);
631
+ final minResult =
632
+ min (minValue, inclusive: inclusive, errorText: errorText)(number);
633
+ final maxResult =
634
+ max (maxValue, inclusive: inclusive, errorText: errorText)(number);
634
635
635
- return errorText ?? minResult ?? maxResult;
636
+ return errorText ?? minResult ?? maxResult;
637
+ }
638
+ return null ;
636
639
};
637
640
}
638
641
You can’t perform that action at this time.
0 commit comments