« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/util/html.js6
1 files changed, 5 insertions, 1 deletions
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 [];