Skip to content

Commit 90bccd6

Browse files
committed
Return callback return to caller in db.collection
1 parent 2d5239d commit 90bccd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mongodb/db.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ Db.prototype.collection = function(collectionName, callback) {
225225
if(collections.length == 0) {
226226
callback(new Error("Collection " + collectionName + " does not exist. Currently in strict mode."), null);
227227
} else {
228-
callback(null, new Collection(self, collectionName, self.pkFactory));
228+
return callback(null, new Collection(self, collectionName, self.pkFactory));
229229
}
230230
});
231231
} else {
232-
callback(null, new Collection(self, collectionName, self.pkFactory));
232+
return callback(null, new Collection(self, collectionName, self.pkFactory));
233233
}
234234
} catch(err) {
235-
callback(err, null);
235+
return callback(err, null);
236236
}
237237
};
238238

0 commit comments

Comments
 (0)