From a03db59c652d68f12f6e37c35748726fdce9bb32 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 27 Nov 2021 13:05:52 +0100 Subject: [PATCH] Don't insert ListenBrainz element if no listens are available. --- source/js/listenbrainz.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/js/listenbrainz.js b/source/js/listenbrainz.js index cbcb564..acc0e78 100644 --- a/source/js/listenbrainz.js +++ b/source/js/listenbrainz.js @@ -6,6 +6,10 @@ window.addEventListener('DOMContentLoaded', async () => { } const data = await result.json(); + if (data.payload.listens.length === 0) { + return; + } + const listen = data.payload.listens[0]; const listenHtml = `