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]) }) }