From 19981732fc50073a80cca29d430005a11426c706 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 18 Aug 2016 10:02:51 +0200 Subject: [PATCH] luci-mod-admin-full: properly skip over unused switch ports Fix incomplete port status display on vlan setup page when ports in the middle are not used, e.g. some Lantiq boards use ports 0, 1, 2 and 4 for LAN ports so JS code should not attempt to reference an undefined status element for port 3. Signed-off-by: Jo-Philipp Wich --- .../luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm index f740a4a86..96fbffdb0 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm @@ -17,6 +17,9 @@ { var th = document.getElementById('portstatus-' + switches[i] + '-' + j); + if (!th) + continue; + if (ports[j].link) { th.innerHTML = String.format( -- 2.11.0