1
Fork 0

Make sure image is defined before using it.

This commit is contained in:
Bauke 2022-03-28 20:23:31 +02:00
parent 2b92f2d5be
commit 4a4188243b
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 1 additions and 1 deletions

View File

@ -63,8 +63,8 @@ function insertHtml(listen, image) {
const text = `${listen.track_metadata.artist_name} - ${listen.track_metadata.track_name}`; const text = `${listen.track_metadata.artist_name} - ${listen.track_metadata.track_name}`;
const alt = image === undefined ? 'ListenBrainz Logo' : `${text} Cover Art`; const alt = image === undefined ? 'ListenBrainz Logo' : `${text} Cover Art`;
image = image.startsWith('http://') ? 'https' + image.slice(4) : image;
image = image ?? 'https://listenbrainz.org/static/img/logo_big.svg'; image = image ?? 'https://listenbrainz.org/static/img/logo_big.svg';
image = image.startsWith('http://') ? 'https' + image.slice(4) : image;
const listenHtml = ` const listenHtml = `
<div class="divider"></div> <div class="divider"></div>