From a2376b826ca26497624222d3dfb60283a2ceb24f Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 28 Jul 2015 20:18:21 +0200 Subject: [PATCH] fix(preprocessor): Better handling of failing preprocessors Closes #1521 --- lib/preprocessor.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/preprocessor.js b/lib/preprocessor.js index cb5e424a1..64f918d96 100644 --- a/lib/preprocessor.js +++ b/lib/preprocessor.js @@ -39,6 +39,8 @@ var createPreprocessor = function (config, basePath, injector) { alreadyDisplayedWarnings[name] = true } + + return instances[name] } patterns.forEach(function (pattern) { @@ -80,9 +82,12 @@ var createPreprocessor = function (config, basePath, injector) { config[patterns[i]].join(', '), file.originalPath) } else { config[patterns[i]].forEach(function (name) { - if (!instances[name]) { - instantiatePreprocessor(name) + var p = instances[name] != null ? instances[name] : instantiatePreprocessor(name) + + if (p == null) { + return log.warn('Could not instantiate perprocessor %s', name) } + preprocessors.push(instances[name]) }) }