From fd961d605305805fe3b6df414339a2774a27239a Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 13 Dec 2017 22:17:13 +0000 Subject: [PATCH] fix: defensive check on accessing cmd.args --- lib/monitor/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/monitor/run.js b/lib/monitor/run.js index 23b5106a..058512b4 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -86,7 +86,7 @@ function run(options) { if ( // this is a hack to avoid forking if there's a node argument being passed // it's a short term fix, and I'm not 100% sure that `fork` is the right way - cmd.args[0].indexOf('-') === -1 && + (cmd.args[0] || '').indexOf('-') === -1 && executable === 'node' && utils.version.major > 4 ) {