Skip to content

Commit f807db7

Browse files
exKAZUurozele
authored andcommitted
Add null check to deal with the usage of { stdio: 'inherit' }. (microsoft#1825)
1 parent 6ae9eac commit f807db7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

local-cli/runWpf/utils/msbuildtools.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ class MSBuildTools {
5757

5858
const cmd = `"${path.join(this.path, 'msbuild.exe')}" ` + ['"' + slnFile + '"'].concat(args).join(' ');
5959
const execOptions = verbose ? { stdio: 'inherit' } : {};
60-
const results = child_process.execSync(cmd, execOptions).toString().split(EOL);
61-
results.forEach(result => console.log(chalk.white(result)));
60+
const result = child_process.execSync(cmd, execOptions);
61+
// result is null when enabling verbose option
62+
if (result != null) {
63+
result.toString().split(EOL).forEach(result => console.log(chalk.white(result)));
64+
}
6265
}
6366
}
6467

0 commit comments

Comments
 (0)