Skip to content

Commit

Permalink
fix(): check that npm scripts exists before checking for properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
jthoms1 committed Nov 10, 2016
1 parent 01112e9 commit 3fde646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Cli.runr = function runr(processArgv) {
log.debug('\nNpm scripts:', npmScripts);
log.debug('Gulpfile found:', gulpLoaded, '\n');

if (npmScripts.hasOwnProperty(taskName + ':before') || npmScripts.hasOwnProperty(taskName + ':after')) {
if (npmScripts && (npmScripts.hasOwnProperty(taskName + ':before') || npmScripts.hasOwnProperty(taskName + ':after'))) {
return Cli.runWithNpmScripts(argv, task, rawCliArguments);
} else if (gulpLoaded) {
return Cli.runWithGulp(argv, task, rawCliArguments);
Expand Down

0 comments on commit 3fde646

Please sign in to comment.