Skip to content

Commit

Permalink
fix: add early return
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 27, 2016
1 parent 8bb3050 commit 4feda4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -150,10 +150,11 @@ Kareem.prototype.execPost = function(name, context, args, options, callback) {
}
} else {
if (post.length === args.length + 2) {
// Skip error handlers if no error
if (++currentPost >= numPosts) {
return callback.apply(null, [null].concat(args));
}
next();
return next();
}
if (post.length === args.length + 1) {
post.apply(context, args.concat(function(error) {
Expand Down

0 comments on commit 4feda4e

Please sign in to comment.