« get me outta code hell

html: SO WE BACK IF && THE MINE - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-12 15:24:11 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-12 15:24:11 -0300
commit0a5a1e3452e7f895d1b2abf3f726e5e4735f79aa (patch)
treef05b55693d7e77b69333a9869c1e1636192774d2 /src/util
parent197aa929bc12168832547dd965ead41b9bab6a32 (diff)
html: SO WE BACK IF && THE MINE
Diffstat (limited to 'src/util')
-rw-r--r--src/util/html.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 7bce9ae8..d1d509e2 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -1838,15 +1838,19 @@ const isAttributesAdditionSingletHelper =
     looseArrayOf(value => isAttributesAdditionSinglet(value)));
 
 export const isAttributesAdditionSinglet = (value) => {
-  if (typeof value === 'object') {
+  if (typeof value === 'object' && value !== null) {
     if (Object.hasOwn(value, blessAttributes)) {
       return true;
     }
 
-    if (Array.isArray(value) && value.length === 1) {
-      if (Object.hasOwn(value[0], blessAttributes)) {
-        return true;
-      }
+    if (
+      Array.isArray(value) &&
+      value.length === 1 &&
+      typeof value[0] === 'object' &&
+      value[0] !== null &&
+      Object.hasOwn(value[0], blessAttributes)
+    ) {
+      return true;
     }
   }