luci-mod-admin-full: fix possible switch status layout bug
authorJo-Philipp Wich <jo@mein.io>
Tue, 26 Jun 2018 13:24:16 +0000 (15:24 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 26 Jun 2018 13:24:16 +0000 (15:24 +0200)
In some cases we might get status information for more ports than which are
actually usable, prevent overflowing the port status row in this case.

Reported-at: https://forum.lede-project.org/t/x/15897/14
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm

index d3d07bead9ab645d523554cf6caedf15858c67cd..8a42a117e143061a3b3da0b4590ea7bdcccd4176 100644 (file)
@@ -35,7 +35,7 @@
                                        {
                                                var th = tr.childNodes[j+1];
 
-                                               if (!th)
+                                               if (!th || !th.hasAttribute('data-name'))
                                                        continue;
 
                                                if (ports[j].link)