Skip to content

Commit

Permalink
added check for ids.length
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuklis committed Oct 9, 2012
1 parent b1fd773 commit d553c6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/retrieve.js
Expand Up @@ -77,6 +77,7 @@ exports.findAndLoad = function findAndLoad(searches, callback) {
var self = this;
this.find(searches, function (err, ids) {
if (err) callback(err, ids);
if (ids.length == 0) callback("not found", ids);
if (ids.length > 0) {
async.map(ids, function (id, callback) {
self.load(id, function (err, props) {
Expand Down

0 comments on commit d553c6f

Please sign in to comment.