Skip to content

Commit

Permalink
chore: fix potential issue with inline asset merging
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Sep 27, 2022
1 parent 78f5999 commit 443d818
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Slot.prototype = {
addInlineCode: function(code, merge) {
if (merge) {
var prev = this.content.length ? this.content[this.content.length - 1] : null;
if (prev && prev.inline && prev.merge) {
if (prev && prev.inline && prev.merge && typeof prev.code === 'string') {
prev.code += '\n' + code;
return;
}
Expand Down Expand Up @@ -70,6 +70,8 @@ Slot.prototype = {
if (builder) {
isTemplate = true;
output.push(builder(content.code));
} else {
throw new Error("Invalid inline content type '" + this.contentType + "'.");
}
} else {
isTemplate = isTemplate || typeof content.code === 'function';
Expand Down

0 comments on commit 443d818

Please sign in to comment.