Skip to content

Commit 3fde646

Browse files
committed
fix(): check that npm scripts exists before checking for properties.
1 parent 01112e9 commit 3fde646

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Cli.runr = function runr(processArgv) {
188188
log.debug('\nNpm scripts:', npmScripts);
189189
log.debug('Gulpfile found:', gulpLoaded, '\n');
190190

191-
if (npmScripts.hasOwnProperty(taskName + ':before') || npmScripts.hasOwnProperty(taskName + ':after')) {
191+
if (npmScripts && (npmScripts.hasOwnProperty(taskName + ':before') || npmScripts.hasOwnProperty(taskName + ':after'))) {
192192
return Cli.runWithNpmScripts(argv, task, rawCliArguments);
193193
} else if (gulpLoaded) {
194194
return Cli.runWithGulp(argv, task, rawCliArguments);

0 commit comments

Comments
 (0)