Browse files

Merge pull request #30 from Garcia/master

Trying to fix issue #29
  • Loading branch information...
2 parents cbbd8ea + c442cb7 commit 4aee79b1fa3c947f7d40cca2d10927e8af06e7dc @masylum committed Dec 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/helpers/update_document.js
View
2 lib/helpers/update_document.js
@@ -82,7 +82,7 @@ function _strategy(op, ret, key, value) {
module.exports = function (VALIDATOR) {
var keys = Object.keys(VALIDATOR.update)
- , special_op = keys[0][0] === '$'
+ , special_op = keys[0] && keys[0][0] === '$'
, ret = special_op ? _.clone(VALIDATOR.document) : _.clone(VALIDATOR.update)
, op, key;

0 comments on commit 4aee79b

Please sign in to comment.