From 469fbdaccc84f9e55fb0997800a9fc19476ba6af Mon Sep 17 00:00:00 2001 From: Uriopass Date: Tue, 15 Aug 2023 00:02:23 +0200 Subject: [PATCH] fix undefined check --- musidex-web/src/pages/merge.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/musidex-web/src/pages/merge.tsx b/musidex-web/src/pages/merge.tsx index 44c63c1..9ff1af8 100644 --- a/musidex-web/src/pages/merge.tsx +++ b/musidex-web/src/pages/merge.tsx @@ -31,6 +31,9 @@ const Merge = (props: MergeProps) => { continue; } let duration = meta.music_tags_idx.get(m1)?.get("duration")?.integer; + if (duration === undefined) { + continue; + } for (let j = i + 1; j < meta.musics.length; j++) { let m2 = meta.musics[j] || 0; // @ts-ignore @@ -39,6 +42,9 @@ const Merge = (props: MergeProps) => { continue; } let duration2 = meta.music_tags_idx.get(m2)?.get("duration")?.integer; + if (duration2 === undefined) { + continue; + } if (s > similarity && Math.abs(duration - duration2) <= 15) { // @ts-ignore dups.push([m1, m2, s]);