[FIX] qweb: fix crash when component only renders empty slot

This commit is contained in:
Samuel Degueldre
2021-11-10 09:04:22 +01:00
committed by Aaron Bohy
parent c03042b44d
commit 7ffb9afbd9
3 changed files with 29 additions and 2 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ function callSlot(
name: string,
defaultSlot?: (ctx: any, key: string) => BDom,
dynamic?: boolean
): BDom | null {
): BDom {
const slots = ctx.__owl__.slots;
const slotFn = slots[name];
const slotBDom = slotFn ? slotFn(parent, key) : null;
@@ -33,7 +33,7 @@ function callSlot(
}
return multi([child1, child2]);
}
return slotBDom;
return slotBDom || text("");
}
function capture(ctx: any): any {