Skip to content

Commit

Permalink
fix(plugin-webpack): check that stats is not empty before sending to …
Browse files Browse the repository at this point in the history
…multi-logger (#1018)
  • Loading branch information
malept authored Jul 12, 2019
1 parent fe33a73 commit aa8587b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Your packaged app may be larger than expected if you dont ignore everything othe
const compiler = webpack(await this.getMainConfig());
const [onceResolve, onceReject] = once(resolve, reject);
const cb: webpack.ICompiler.Handler = (err, stats) => {
if (tab) {
if (tab && stats) {
tab.log(stats.toString({
colors: true,
}));
Expand Down Expand Up @@ -443,9 +443,11 @@ Your packaged app may be larger than expected if you dont ignore everything othe
const tab = logger.createTab(`${entryPoint.name} - Preload`);
const [onceResolve, onceReject] = once(resolve, reject);
const cb: webpack.ICompiler.Handler = (err, stats) => {
tab.log(stats.toString({
colors: true,
}));
if (stats) {
tab.log(stats.toString({
colors: true,
}));
}

if (err) return onceReject(err);
return onceResolve();
Expand Down

0 comments on commit aa8587b

Please sign in to comment.