diff --git a/lib/util.js b/lib/util.js index 9427e8ec..7dec724c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -62,16 +62,15 @@ this.checkArgs = function(argsParam, names) { var error, msg = '', - i = 0, n = names.length, isLength = n === argsParam.length, template = '{{ name }} coud not be empty!'; if (!isLength) - for (i = 0; i < n; i++) - if (!argsParam[i]) { + while (--n) + if (argsParam[n] === undefined) { msg = Util.render(template, { - name: names[i] + name: names[n] }); error = new Error(msg);