Skip to content

Commit

Permalink
Merge branch 'VladSt90-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
foxhound87 committed Feb 21, 2024
2 parents e9b6ada + d6e006d commit 6280f50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validators/ZOD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class ZOD implements ValidationPluginInterface {
validate(field): void {
const result = this.schema.safeParse(field.state.form.validatedValues);
if (result.success) return;
const errors = _.get(result.error.format(), field.path)._errors;
if (errors.length) field.validationErrorStack = errors;
const errors = _.get(result.error.format(), field.path)?._errors;
if (errors?.length) field.validationErrorStack = errors;
}
}

Expand Down

0 comments on commit 6280f50

Please sign in to comment.