Skip to content

Commit

Permalink
linkedin#733 remove confusing debug message when blocks are not in co…
Browse files Browse the repository at this point in the history
…ntext but we have blocks to look at
  • Loading branch information
jimmyhchan committed Jan 10, 2017
1 parent e0e25f7 commit 3372064
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions lib/dust.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,20 +504,17 @@

blocks = this.blocks;

if (!blocks) {
dust.log('No blocks for context `' + key + '` in template `' + this.getTemplateName() + '`', DEBUG);
return false;
}

len = blocks.length;
while (len--) {
fn = blocks[len][key];
if (fn) {
return fn;
if (blocks) {
len = blocks.length;
while (len--) {
fn = blocks[len][key];
if (fn) {
return fn;
}
}
}

dust.log('Malformed template `' + this.getTemplateName() + '` was missing one or more blocks.');
dust.log('No blocks for context `' + key + '` in template `' + this.getTemplateName() + '`', DEBUG);
return false;
};

Expand Down

0 comments on commit 3372064

Please sign in to comment.