From 0f7106a80debcf6a561a08158ab588383ba6838f Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Fri, 29 May 2026 19:34:52 +0000 Subject: [PATCH] Fix SITES tab: check for modal before getElementById on missing pane --- public_html/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index cdc8553..a54b84a 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -1507,14 +1507,15 @@ async function loadNews() { // ── TABS ────────────────────────────────────────────────────────────── function switchTab(name) { + if (name === 'sites') { openSitesModal(); return; } document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); document.querySelectorAll('.tab-pane').forEach(p => p.classList.remove('active')); event.target.classList.add('active'); - document.getElementById('tab-'+name).classList.add('active'); + const pane = document.getElementById('tab-'+name); + if (pane) pane.classList.add('active'); if (name === 'news') loadNews(); if (name === 'agents') loadAgents(); if (name === 'alerts') loadAlerts(); - if (name === 'sites') { openSitesModal(); return; } } // ── CHAT ──────────────────────────────────────────────────────────────