From 1b35c9324351a65e185189d69ec8ecef6d8f0a94 Mon Sep 17 00:00:00 2001 From: xenofem Date: Thu, 16 Nov 2023 21:37:15 -0500 Subject: [PATCH] fix (harmless) uncaught TypeError when viewing the download page for a single file --- static/js/download.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/download.js b/static/js/download.js index 555baa5..01e1a97 100644 --- a/static/js/download.js +++ b/static/js/download.js @@ -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(() => {