Skip to content

Commit a55fba7

Browse files
committedNov 5, 2015
fix; allow undefined for min/max validators (Fix #3539)
1 parent cfc3194 commit a55fba7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lib/schema/number.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ SchemaNumber.prototype.min = function(value, message) {
9292
msg = msg.replace(/{MIN}/, value);
9393
this.validators.push({
9494
validator: this.minValidator = function(v) {
95-
return v === null || v >= value;
95+
return v == null || v >= value;
9696
},
9797
message: msg,
9898
type: 'min',
@@ -146,7 +146,7 @@ SchemaNumber.prototype.max = function(value, message) {
146146
msg = msg.replace(/{MAX}/, value);
147147
this.validators.push({
148148
validator: this.maxValidator = function(v) {
149-
return v === null || v <= value;
149+
return v == null || v <= value;
150150
},
151151
message: msg,
152152
type: 'max',

0 commit comments

Comments
 (0)
Please sign in to comment.