mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
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:
@@ -36,6 +36,10 @@ export const JoinedArtists = ({
|
|||||||
|
|
||||||
for (const artist of artists) {
|
for (const artist of artists) {
|
||||||
const name = artist.name;
|
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');
|
const regex = new RegExp(escapeRegex(name), 'gi');
|
||||||
let match: null | RegExpExecArray = null;
|
let match: null | RegExpExecArray = null;
|
||||||
while ((match = regex.exec(artistName)) !== null) {
|
while ((match = regex.exec(artistName)) !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user