Permalink
Browse files

fixed bug validator with null values evaluating regexes

  • Loading branch information...
1 parent 0c34b3d commit 01e671df6535ff70040730ca14bdb643bb65b251 @masylum masylum committed Jan 2, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/validator.js
  2. +1 −1 package.json
View
@@ -79,7 +79,7 @@ module.exports = function (model, data) {
validator.validateRegex = function (validations) {
getKeys(validations).forEach(function (key, i) {
- if (!this.data[key].match(validations[key][0])) {
+ if (!this.data[key] || !this.data[key].match(validations[key][0])) {
this.addError(key, validations[key][1]);
}
}, this);
View
@@ -1,7 +1,7 @@
{
"name": "mongolia",
"description": "Mongodb driver wrapper. Acts as model.",
- "version": "0.0.8",
+ "version": "0.0.9",
"author": "Pau Ramon <masylum@gmail.com>",
"keywords": ["mongo", "mongodb", "orm", "database", "db"],
"main": "./index",

0 comments on commit 01e671d

Please sign in to comment.