From 341ea73e9730473212b39c63219601d8170f6324 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 12 Mar 2023 21:57:03 +0400 Subject: [PATCH] Check if tbody is present and create it if doesn't. --- web/assets/js/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 6de8f0c..9052b25 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -23,6 +23,9 @@ function updateLastPlayedSong() { .then(last_played => { if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText) return; + + if ($('last-played').firstChild === null) + $('last-played').appendChild(document.createElement("tbody")) if ($('last-played').firstChild.children.length == 10) $('last-played').firstChild.firstChild.remove();