From cada7ff1794a30ccc2be3bb67f35fbdb2b39081c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9licien=20FRANCOIS?= Date: Wed, 10 Feb 2016 11:33:01 +0100 Subject: [PATCH] When last argument is falsy, Override by default callback instead of appending it --- lib/executor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/executor.js b/lib/executor.js index a555bd3..70ec590 100755 --- a/lib/executor.js +++ b/lib/executor.js @@ -31,6 +31,9 @@ function Executor () { }; newArguments[newArguments.length - 1] = callback; + } else if (!lastArg && task.arguments.length) { + callback = function () { cb(); }; + newArguments[newArguments.length - 1] = callback; } else { callback = function () { cb(); }; newArguments.push(callback);