Skip to content

Commit a3e50c6

Browse files
authored
fix(zodResolver): cannot read properties of undefined (reading 'length')
1 parent f0174e0 commit a3e50c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zod/src/zod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { z, ZodError } from 'zod';
33
import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';
44
import type { Resolver } from './types';
55

6-
const isZodError = (error: any): error is ZodError => error.errors != null;
6+
const isZodError = (error: any): error is ZodError => Array.isArray(error?.errors);
77

88
const parseErrorSchema = (
99
zodErrors: z.ZodIssue[],

0 commit comments

Comments
 (0)