Skip to content

Commit

Permalink
Check if argv is set in array, instead of checking falsey
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Sorohan committed Jan 30, 2018
1 parent f44fa3b commit 92d6e49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -747,7 +747,7 @@ Command.prototype.parseOptions = function(argv) {
// If the next argument looks like it might be
// an argument for this option, we pass it on.
// If it isn't, then it'll simply be ignored
if (argv[i + 1] && argv[i + 1][0] !== '-') {
if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
unknownOptions.push(argv[++i]);
}
continue;
Expand Down

0 comments on commit 92d6e49

Please sign in to comment.