From 47a2d6a9adf5059c194350e61d6beb3ff083088c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 29 Mar 2023 09:41:19 -0300 Subject: html: pass null/undefined through in slot values --- src/util/html.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/html.js b/src/util/html.js index 3980b9aa..5ea5e0ad 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -398,7 +398,11 @@ export class Template { getSlot(slotName) { if (this.#slotContents[slotName]) { - const contents = this.#slotContents[slotName].map(item => item.valueOf()); + const contents = this.#slotContents[slotName] + .map(item => + (item === null || item === undefined + ? item + : item.valueOf())); return new Tag(null, null, contents).valueOf(); } else { return []; -- cgit 1.3.0-6-gf8a5