fix(@embark/pipeline): check if config arg of writeStats is falsy

When passing the name of a build pipeline that doesn't exist, e.g.
`embark run|build --pipeline foo`, `writeStats` would cause an unhandled
promise rejection because its config argument is falsy. Checking for that and
returning early from `writeStats` allows the `"no webpack config has the name
'foo'"` error to be reported correctly.
This commit is contained in:
Michael Bradley, Jr 2019-08-08 16:33:49 -05:00 committed by Michael Bradley
parent e58c5528a6
commit 9d81fc5b1c
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class WebpackProcess extends ProcessWrapper {
}
async writeStats(config, stats, callback){
if (!config.stats || config.stats === 'none') {
if (!config || !config.stats || config.stats === 'none') {
return callback();
}
try {