Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validateMultiple throws exception on multiple errors #265

Open
fbrunet99 opened this issue Aug 8, 2018 · 0 comments
Open

validateMultiple throws exception on multiple errors #265

fbrunet99 opened this issue Aug 8, 2018 · 0 comments

Comments

@fbrunet99
Copy link

validateMutliple may throw an exception when there are multiple errors. It tries to access "this.error.message" but this.error is undefined. Instead, "this.errors" is an array that contains the errors.

A possible fix is to change tv4.js line 1603-1605 to this so it can handle either this.error or this.errors:

var result = {toString: function () {
  return this.valid ? 'valid' : this.error ? this.error.message : this.errors ? JSON.stringify(this.errors, null, '\t') : 'invalid'
}};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant