« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateMusicVideoDateLine.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateMusicVideoDateLine.js')
-rw-r--r--src/content/dependencies/generateMusicVideoDateLine.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/content/dependencies/generateMusicVideoDateLine.js b/src/content/dependencies/generateMusicVideoDateLine.js
index 0c30ead5..98992584 100644
--- a/src/content/dependencies/generateMusicVideoDateLine.js
+++ b/src/content/dependencies/generateMusicVideoDateLine.js
@@ -2,6 +2,7 @@ function sameDay(musicVideo, thing) {
   if (!musicVideo.dateIsSpecified) return null;
 
   const compare = (a, b) =>
+    a && b &&
     a.toDateString() === b.toDateString();
 
   const album = thing.isTrack ? thing.album : thing;
@@ -15,7 +16,7 @@ function sameDay(musicVideo, thing) {
     }
   }
 
-  if (compare(musicVideo.date, track.date)) {
+  if (compare(musicVideo.date, track?.date)) {
     return 'track';
   }