Skip to content

Commit

Permalink
fix(preprocessor): Better handling of failing preprocessors
Browse files Browse the repository at this point in the history
Closes #1521
  • Loading branch information
dignifiedquire committed Jul 28, 2015
1 parent 0f33268 commit a2376b8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/preprocessor.js
Expand Up @@ -39,6 +39,8 @@ var createPreprocessor = function (config, basePath, injector) {

alreadyDisplayedWarnings[name] = true
}

return instances[name]
}

patterns.forEach(function (pattern) {
Expand Down Expand Up @@ -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])
})
}
Expand Down

0 comments on commit a2376b8

Please sign in to comment.