Skip to content

Commit a2376b8

Browse files
fix(preprocessor): Better handling of failing preprocessors
Closes #1521
1 parent 0f33268 commit a2376b8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/preprocessor.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ var createPreprocessor = function (config, basePath, injector) {
3939

4040
alreadyDisplayedWarnings[name] = true
4141
}
42+
43+
return instances[name]
4244
}
4345

4446
patterns.forEach(function (pattern) {
@@ -80,9 +82,12 @@ var createPreprocessor = function (config, basePath, injector) {
8082
config[patterns[i]].join(', '), file.originalPath)
8183
} else {
8284
config[patterns[i]].forEach(function (name) {
83-
if (!instances[name]) {
84-
instantiatePreprocessor(name)
85+
var p = instances[name] != null ? instances[name] : instantiatePreprocessor(name)
86+
87+
if (p == null) {
88+
return log.warn('Could not instantiate perprocessor %s', name)
8589
}
90+
8691
preprocessors.push(instances[name])
8792
})
8893
}

0 commit comments

Comments
 (0)