« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateAlbumAdditionalFilesList.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/content/dependencies/generateAlbumAdditionalFilesList.js b/src/content/dependencies/generateAlbumAdditionalFilesList.js
index 3ab0e27a..b9269d74 100644
--- a/src/content/dependencies/generateAlbumAdditionalFilesList.js
+++ b/src/content/dependencies/generateAlbumAdditionalFilesList.js
@@ -20,13 +20,15 @@ export default {
 
     chunkItems:
       additionalFiles
-        .map(({files}) => files
-          .map(() => relation('generateAdditionalFilesListChunkItem'))),
+        .map(({files}) =>
+          (files ?? [])
+            .map(() => relation('generateAdditionalFilesListChunkItem'))),
 
     chunkItemFileLinks:
       additionalFiles
-        .map(({files}) => files
-          .map(file => relation('linkAlbumAdditionalFile', album, file))),
+        .map(({files}) =>
+          (files ?? [])
+            .map(file => relation('linkAlbumAdditionalFile', album, file))),
   }),
 
   data: (album, additionalFiles) => ({
@@ -38,11 +40,11 @@ export default {
 
     chunkDescriptions:
       additionalFiles
-        .map(({description}) => description),
+        .map(({description}) => description ?? null),
 
     chunkItemLocations:
       additionalFiles
-        .map(({files}) => files),
+        .map(({files}) => files ?? []),
   }),
 
   slots: {