From b356267f2ed2d089f6dbf1a4df6d85eee9d3ccac Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:05:14 +0000 Subject: [PATCH] feat: Prevent notification errors for unauthenticated users --- website/templates/includes/header.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/templates/includes/header.html b/website/templates/includes/header.html index db9a39cb12..637e8bc8b0 100644 --- a/website/templates/includes/header.html +++ b/website/templates/includes/header.html @@ -1067,6 +1067,11 @@

Chat with BLT Bot

const unreadCount = document.getElementById("unreadCount"); const notificationList = document.getElementById("notificationList"); + // Early exit if notification elements don't exist (unauthenticated users) + if (!notificationButton || !notificationDropdown || !unreadCount || !notificationList) { + return; + } + async function fetchNotifications() { try { const response = await fetch("{% url 'fetch_notifications' %}", {