« get me outta code hell

language: #formatListHelper: explicitly blank for null/undefined - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-07 16:25:01 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-07 20:28:02 -0300
commit27f6a5b771dbab7aff6057f3f52a8252a143b38a (patch)
treecb4424054a502901e53d8bacfe5e9598f27aacf5
parente7a026a9b5ccce1ccf11c37c4dcd7fbce89b05cf (diff)
language: #formatListHelper: explicitly blank for null/undefined
Undefined isn't implied by empty() call so this is a behavioral
change, too.
-rw-r--r--src/data/things/language.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/data/things/language.js b/src/data/things/language.js
index 82b08c9f..f20927a4 100644
--- a/src/data/things/language.js
+++ b/src/data/things/language.js
@@ -738,8 +738,8 @@ export class Language extends Thing {
   }
 
   #formatListHelper(array, processFn) {
-    // Empty lists are blank content.
-    if (empty(array)) {
+    // Empty lists, null, and undefined are blank content.
+    if (empty(array) || array === null || array === undefined) {
       return html.blank();
     }