Skip to content

Commit

Permalink
Fix foreach.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorribas committed Mar 21, 2015
1 parent a27cdcc commit c9f5d92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ Cursor.prototype.forEach = function(fn) {
var loop = function() {
self.next(function(err, obj) {
if (err) return fn(err);
if (!obj) return;
fn(err, obj);

if (!obj) return;
loop();
});
};
Expand Down

0 comments on commit c9f5d92

Please sign in to comment.