Closed jcheroske closed 6 years ago
It assumes that you're passing in an object that you want to validate. I guess it would make some sense for it to throw a clearer error if what you pass in is NOT an object, especially in the case of using it for method argument validation. I don't think it would be correct for this to be a ValidationError, though (even though I understand why you think it would make sense for validated-method). Probably the best solution is to update the validated-method package to throw its own ValidationError when the argument is null
.
I defer to your better judgement on this. I just wanted to point it out to you.
On Tuesday, September 13, 2016, Eric Dobbertin notifications@github.com wrote:
It assumes that you're passing in an object that you want to validate. I guess it would make some sense for it to throw a clearer error if what you pass in is NOT an object, especially in the case of using it for method argument validation. I don't think it would be correct for this to be a ValidationError, though (even though I understand why you think it would make sense for validated-method). Probably the best solution is to update the validated-method package to throw its own ValidationError when the argument is null.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aldeed/meteor-simple-schema/issues/649#issuecomment-246871470, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgUylWMwDvOB0_calNlpLaqnKk9HA53ks5qp0LBgaJpZM4Jqj9e .
The Meteor SimpleSchema package is no longer maintained other than critical fixes to keep it running with each latest Meteor release. Closing non-critical issues in this repo. Anyone who cares about this may do one or more of the following:
I'm using simple-schema with the validated-method package, and making use of the
validator()
method. Ifnull
is passed to the returned validation function, a TypeError is thrown:TypeError: Cannot use 'in' operator to search for '$pushAll' in null'
This error is useless. Shouldn't passing
null
result in a ValidationError being thrown?