diff --git a/allstarr/wwwroot/index.html b/allstarr/wwwroot/index.html index 105f5a9..e33f7ed 100644 --- a/allstarr/wwwroot/index.html +++ b/allstarr/wwwroot/index.html @@ -1618,7 +1618,9 @@ // Use JSON.stringify to properly escape strings for JavaScript const escapedName = JSON.stringify(name); const escapedTitle = JSON.stringify(t.title || ''); - const escapedArtist = JSON.stringify((t.artists && t.artists[0]) || ''); + // Safely get first artist, defaulting to empty string + const firstArtist = (t.artists && t.artists.length > 0) ? t.artists[0] : ''; + const escapedArtist = JSON.stringify(firstArtist); const escapedSpotifyId = JSON.stringify(t.spotifyId || ''); mapButton = ``; } @@ -1628,7 +1630,7 @@ ${t.position + 1}

${escapeHtml(t.title)}${statusBadge}${mapButton}

- ${escapeHtml(t.artists.join(', '))} + ${escapeHtml((t.artists || []).join(', '))}
${t.album ? escapeHtml(t.album) : ''}