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 ──────────────────────────────────────────────────────────────