Skip to content

Commit 8690e80

Browse files
author
Ryan Ip
committed
Avoid loading partial files when partial value is undefined/null/false
1 parent 894b0de commit 8690e80

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
@@ -118,6 +118,10 @@ function readPartials(path, options, fn) {
118118
function next(index) {
119119
if (index === keys.length) return fn(null);
120120
var key = keys[index];
121+
var filename = partials[key];
122+
if (filename === undefined || filename === null || filename === false) {
123+
return next(++index);
124+
}
121125
var file = join(dirname(path), partials[key] + extname(path));
122126
read(file, options, function(err, str){
123127
if (err) return fn(err);

0 commit comments

Comments
 (0)