Skip to content

Commit

Permalink
fix; allow undefined for min/max validators (Fix #3539)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 5, 2015
1 parent cfc3194 commit a55fba7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/schema/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ SchemaNumber.prototype.min = function(value, message) {
msg = msg.replace(/{MIN}/, value);
this.validators.push({
validator: this.minValidator = function(v) {
return v === null || v >= value;
return v == null || v >= value;
},
message: msg,
type: 'min',
Expand Down Expand Up @@ -146,7 +146,7 @@ SchemaNumber.prototype.max = function(value, message) {
msg = msg.replace(/{MAX}/, value);
this.validators.push({
validator: this.maxValidator = function(v) {
return v === null || v <= value;
return v == null || v <= value;
},
message: msg,
type: 'max',
Expand Down

0 comments on commit a55fba7

Please sign in to comment.