summaryrefslogtreecommitdiff
path: root/_layouts/postlist.html
diff options
context:
space:
mode:
authoruvok cheetah2025-03-11 18:43:39 +0100
committeruvok cheetah2025-03-11 18:43:39 +0100
commitbec978927a4d12ff7355a06a3300d9a01e09059d (patch)
treef8e9e925468c6192512001f03104b8d8bcd0961d /_layouts/postlist.html
parent54ea26ef244681eec33c3e2035db0252d9defae1 (diff)
Prevent JS code crash if element ID not foundHEADmaster
Diffstat (limited to '_layouts/postlist.html')
-rw-r--r--_layouts/postlist.html3
1 files changed, 3 insertions, 0 deletions
diff --git a/_layouts/postlist.html b/_layouts/postlist.html
index ee9dde6..b6b29ef 100644
--- a/_layouts/postlist.html
+++ b/_layouts/postlist.html
@@ -64,6 +64,9 @@ layout: default
const ids = {{ news_ids }};
for (currId of ids) {
const currentBanner = document.getElementById(currId);
+ if (!currentBanner) {
+ continue;
+ }
const closeLink = currentBanner.firstElementChild;
const currentNewsClosed = localStorage.getItem(currId+"closed");
if (currentNewsClosed === "true") {