Check that args are present before mapping over

Closes #2925
This commit is contained in:
Kevin Sawicki
2014-07-11 08:40:22 -07:00
parent 49b825aeb3
commit 6d2b70b3d9

View File

@@ -45,7 +45,10 @@ class BufferedProcess
# Related to joyent/node#2318
if process.platform is "win32"
# Quote all arguments and escapes inner quotes
cmdArgs = args.map (arg) -> "\"#{arg.replace(/"/g, '\\"')}\""
if args?
cmdArgs = args.map (arg) -> "\"#{arg.replace(/"/g, '\\"')}\""
else
cmdArgs = []
cmdArgs.unshift("\"#{command}\"")
cmdArgs = ['/s', '/c', "\"#{cmdArgs.join(' ')}\""]
cmdOptions = _.clone(options)