Skip to content

Commit 7131348

Browse files
- Made name more correct
1 parent 0511bc8 commit 7131348

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/core/src/components/Form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,18 +604,18 @@ export default class Form<
604604
if (resolvedSchema?.type !== 'object' && resolvedSchema?.type !== 'array') {
605605
filteredErrors.__errors = schemaErrors.__errors;
606606
}
607-
// Removing undefined and empty errors.
608-
const filterUndefinedErrors = (errors: any): ErrorSchema<T> => {
607+
// Removing undefined, null and empty errors.
608+
const filterNilOrEmptyErrors = (errors: any): ErrorSchema<T> => {
609609
_forEach(errors, (errorAtKey, errorKey: keyof typeof errors) => {
610610
if (_isNil(errorAtKey)) {
611611
delete errors[errorKey];
612612
} else if (typeof errorAtKey === 'object' && !Array.isArray(errorAtKey.__errors)) {
613-
filterUndefinedErrors(errorAtKey);
613+
filterNilOrEmptyErrors(errorAtKey);
614614
}
615615
});
616616
return errors;
617617
};
618-
return filterUndefinedErrors(filteredErrors);
618+
return filterNilOrEmptyErrors(filteredErrors);
619619
}
620620

621621
/** Function to handle changes made to a field in the `Form`. This handler receives an entirely new copy of the

0 commit comments

Comments
 (0)