[FIX] compiler: allow t-if with empty content

This commit is contained in:
Géry Debongnie
2021-12-01 13:16:32 +01:00
committed by Samuel Degueldre
parent e2fedc6eff
commit e008966291
4 changed files with 37 additions and 4 deletions
+1 -4
View File
@@ -639,10 +639,7 @@ function parseTIf(node: Element, ctx: ParsingContext): AST | null {
}
const condition = node.getAttribute("t-if")!;
node.removeAttribute("t-if");
const content = parseNode(node, ctx);
if (!content) {
throw new Error("hmmm");
}
const content = parseNode(node, ctx) || { type: ASTType.Text, value: "" };
let nextElement = node.nextElementSibling;
// t-elifs