From 2fd075ff212a27044a02d79099316d0d6f2c0e39 Mon Sep 17 00:00:00 2001 From: Denis Sokolov Date: Mon, 29 Feb 2016 18:12:35 +0200 Subject: [PATCH] Properly throw an error in compiler even when childCompilation is missing For some errors, no other parameters to the function are even given, only the error object in `err`. --- lib/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compiler.js b/lib/compiler.js index c118750..1577830 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -71,7 +71,7 @@ module.exports.compileTemplate = function compileTemplate (template, context, ou delete compilation.assets[outputOptions.filename]; } // Resolve / reject the promise - if (childCompilation.errors && childCompilation.errors.length) { + if (childCompilation && childCompilation.errors && childCompilation.errors.length) { var errorDetails = childCompilation.errors.map(function (error) { return error.message + (error.error ? ':\n' + error.error : ''); }).join('\n');