diff options
| author | uvok cheetah | 2025-03-11 18:43:39 +0100 | 
|---|---|---|
| committer | uvok cheetah | 2025-03-11 18:43:39 +0100 | 
| commit | bec978927a4d12ff7355a06a3300d9a01e09059d (patch) | |
| tree | f8e9e925468c6192512001f03104b8d8bcd0961d /_layouts | |
| parent | 54ea26ef244681eec33c3e2035db0252d9defae1 (diff) | |
Prevent JS code crash if element ID not found
Diffstat (limited to '_layouts')
| -rw-r--r-- | _layouts/postlist.html | 3 | 
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") {  | 
