From 3e3f2333e46fecad555204d1f058083acdfd4178 Mon Sep 17 00:00:00 2001 From: claude-timemachine Date: Thu, 11 Jun 2026 00:08:17 +0200 Subject: [PATCH] ui: guard meta count against null tunnels list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /api/tunnels returns {"tunnels": null} when no bridges are active. The previous code path short-circuited the empty render but still dereferenced j.tunnels.length on the line that updates the header meta — TypeError, then the "— connecting…" placeholder stuck around forever. Coalesce to [] before .length. Co-Authored-By: Claude Opus 4.7 --- internal/httpsrv/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/httpsrv/static/index.html b/internal/httpsrv/static/index.html index 549d0c6..6fe7337 100644 --- a/internal/httpsrv/static/index.html +++ b/internal/httpsrv/static/index.html @@ -118,7 +118,7 @@ async function refreshConnections() { rows.appendChild(tr); } } - document.getElementById('meta').textContent = '— ' + j.tunnels.length + ' tunnels'; + document.getElementById('meta').textContent = '— ' + ((j.tunnels || []).length) + ' tunnels'; } catch (e) { document.getElementById('meta').textContent = '— api error'; }