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>
This commit is contained in:
Qimiao Chen
2026-01-03 16:53:26 +08:00
committed by GitHub
parent e696c0c636
commit af0354a4d5
@@ -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) {