From: Jo-Philipp Wich Date: Thu, 18 Aug 2016 08:02:51 +0000 (+0200) Subject: luci-mod-admin-full: properly skip over unused switch ports X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=19981732fc50073a80cca29d430005a11426c706;hp=c390a09cea580ddb0a400c844751f0b65b69d3aa;ds=inline 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 --- 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(