Skip to content

Commit

Permalink
fix: safely access error object in ValidationError
Browse files Browse the repository at this point in the history
  • Loading branch information
siikasmaa committed Jan 9, 2025
1 parent 64d8739 commit e1f5779
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class ValidationError extends Error {
: Value.Errors(validator, value).First()

const customError =
error.schema.message || error?.schema.error !== undefined
error?.schema.message || error?.schema.error !== undefined
? typeof error.schema.error === 'function'
? error.schema.error({
type,
Expand Down

0 comments on commit e1f5779

Please sign in to comment.