Skip to content

Commit

Permalink
fix(zodResolver): cannot read properties of undefined (reading 'length')
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanelian authored Jul 2, 2024
1 parent f0174e0 commit a3e50c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zod/src/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { z, ZodError } from 'zod';
import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';
import type { Resolver } from './types';

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

const parseErrorSchema = (
zodErrors: z.ZodIssue[],
Expand Down

0 comments on commit a3e50c6

Please sign in to comment.