« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/things/thing.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 91ad96af..79d8ae0e 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -491,19 +491,20 @@ export function withResolvedReferenceList({
         let matches =
           list.map(ref => findFunction(ref, data, {mode: 'quiet'}));
 
-        if (!matches.includes(null)) {
+        if (matches.every(match => match)) {
           return continuation.raise({matches});
         }
 
         switch (notFoundMode) {
           case 'filter':
-            matches = matches.filter(value => value !== null);
+            matches = matches.filter(match => match);
             return continuation.raise({matches});
 
           case 'exit':
             return continuation.exit([]);
 
           case 'null':
+            matches = matches.map(match => match ?? null);
             return continuation.raise({matches});
         }
       },