Return null when findOne could not find record, closes #128
This commit is contained in:
parent
0096c94d8f
commit
cefd79dbf6
|
@ -381,7 +381,7 @@ AbstractClass.findOne = function findOne(params, cb) {
|
|||
}
|
||||
params.limit = 1;
|
||||
this.all(params, function (err, collection) {
|
||||
if (err || !collection || !collection.length > 0) return cb(err);
|
||||
if (err || !collection || !collection.length > 0) return cb(err, null);
|
||||
cb(err, collection[0]);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue