« get me outta code hell

client: templateContent: pass through null <template> - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-09 16:47:41 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-09 17:53:28 -0300
commit54c2c6e5116ebb90922b30cc8fcd7309cd0dcb42 (patch)
treeb988239199f22c6006d28f813c1a5001721c3d86 /src/static/js
parentf2d41e51686377df92963aac42b584e1ed8ab607 (diff)
client: templateContent: pass through null <template>
Diffstat (limited to 'src/static/js')
-rw-r--r--src/static/js/client.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/static/js/client.js b/src/static/js/client.js
index 733e4586..8b470832 100644
--- a/src/static/js/client.js
+++ b/src/static/js/client.js
@@ -237,6 +237,10 @@ function cssProp(el, ...args) {
 }
 
 function templateContent(el) {
+  if (el === null) {
+    return null;
+  }
+
   if (el?.nodeName !== 'TEMPLATE') {
     throw new Error(`Expected a <template> element`);
   }