« get me outta code hell

language: return html.blank() from formatExternalLink - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-31 19:06:32 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-03-31 19:07:45 -0300
commitbadf0e751a24c55c0c5b7e13674ca71aa0287664 (patch)
tree9518b0dd327aa6a160542750da22385fa0d8086a /src/data
parentbc1ac5e6e89d64136ba5c8bbaf8cee22e6d1d5aa (diff)
language: return html.blank() from formatExternalLink
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/language.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/data/things/language.js b/src/data/things/language.js
index 4079ee7..5573ce2 100644
--- a/src/data/things/language.js
+++ b/src/data/things/language.js
@@ -540,10 +540,16 @@ export class Language extends Thing {
 
     isExternalLinkStyle(style);
 
-    return getExternalLinkStringOfStyleFromDescriptors(url, style, this.externalLinkSpec, {
-      language: this,
-      context,
-    });
+    const result =
+      getExternalLinkStringOfStyleFromDescriptors(url, style, this.externalLinkSpec, {
+        language: this,
+        context,
+      });
+
+    // It's possible for there to not actually be any string available for the
+    // given URL, style, and context, and we want this to be detectable via
+    // html.blank().
+    return result ?? html.blank();
   }
 
   formatIndex(value) {