diff --git a/lib/dao.js b/lib/dao.js index 1c18853c..b172298c 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -469,6 +469,7 @@ DataAccessObject.findOne = function findOne(params, cb) { cb = params; params = {}; } + params = params || {}; params.limit = 1; this.find(params, function (err, collection) { if (err || !collection || !collection.length > 0) return cb(err, null);