Skip to content

Commit d0ee1ec

Browse files
authored
Merge pull request #290 from iKoala/master
Avoid loading partial files when partial value is undefined/null/false
2 parents c9a94a5 + 08b3fac commit d0ee1ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/consolidate.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ function readPartials(path, options, fn) {
122122
var key = keys[index];
123123
var partialPath = partials[key];
124124

125+
if (partialPath === undefined || partialPath === null || partialPath === false) {
126+
return next(++index);
127+
}
128+
125129
var file;
126130
if (isAbsolute(partialPath)) {
127131
if (extname(partialPath) !== '') {

0 commit comments

Comments
 (0)