不要怂,就是干,撸起袖子干!

watch for undefined values too before triggering validators

1 parent a14173af
Showing with 4 additions and 3 deletions
...@@ -244,9 +244,8 @@ DaoValidator.prototype._customValidators = function() { ...@@ -244,9 +244,8 @@ DaoValidator.prototype._customValidators = function() {
*/ */
DaoValidator.prototype._builtinAttrValidate = function(value, field) { DaoValidator.prototype._builtinAttrValidate = function(value, field) {
var self = this; var self = this;
// check if value is null (if null not allowed the Schema pass will capture it) // check if value is null (if null not allowed the Schema pass will capture it)
if (value === null) { if (value === null || typeof value === 'undefined') {
return Promise.resolve(); return Promise.resolve();
} }
......
...@@ -57,7 +57,9 @@ describe(Support.getTestDialectTeaser("DAO"), function () { ...@@ -57,7 +57,9 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
expect(u2.username).to.equal(bio) expect(u2.username).to.equal(bio)
done() done()
}) })
}) }).error(function(err) {
done(err);
});
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!