fix (harmless) uncaught TypeError when viewing the download page for a single file

main
xenofem 2023-11-16 21:37:15 -05:00
parent 8b001911f7
commit 1b35c93243
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
let updateInterval;
document.addEventListener("DOMContentLoaded", () => {
const table = document.getElementById("download_contents").getElementsByTagName("tbody")[0];
const downloadContents = document.getElementById("download_contents");
if (!downloadContents) { return; }
const table = downloadContents.getElementsByTagName("tbody")[0];
if (table.children.length === 0) { return; }
updateInterval = setInterval(() => {