From f257546c72b6412b0ecc5fd135d5af1dca14150b Mon Sep 17 00:00:00 2001 From: JackySee Date: Fri, 16 Jan 2015 10:04:50 +0800 Subject: [PATCH] error code maybe null I've come across a case that on Windows machine running a watch parallel with jetty, sometimes it gives code = null, which will fail the scripts. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 004c50d..f2a2e47 100755 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ var exec = require('child_process').exec; function potentialExit (childCmd, code) { - code = code.code || code; + code = code? (code.code || code) : code; if (code > 0) { console.error('`' + childCmd + '` failed with exit code ' + code); process.exit(code);