From af0354a4d5a583920da59801e9f3c0ccc3fb7e40 Mon Sep 17 00:00:00 2001 From: Qimiao Chen Date: Sat, 3 Jan 2026 16:53:26 +0800 Subject: [PATCH] Avoid an infinite loop when artist.name is an empty string. (#1483) * Avoid an infinite loop when is an empty string. --------- Co-authored-by: Jeff <42182408+jeffvli@users.noreply.github.com> --- src/renderer/features/albums/components/joined-artists.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/features/albums/components/joined-artists.tsx b/src/renderer/features/albums/components/joined-artists.tsx index 74256c214..712716065 100644 --- a/src/renderer/features/albums/components/joined-artists.tsx +++ b/src/renderer/features/albums/components/joined-artists.tsx @@ -36,6 +36,10 @@ export const JoinedArtists = ({ for (const artist of artists) { const name = artist.name; + + // Avoid an infinite loop when `artist.name` is an empty string. + if (!name) continue; + const regex = new RegExp(escapeRegex(name), 'gi'); let match: null | RegExpExecArray = null; while ((match = regex.exec(artistName)) !== null) {