modules/admin-full: fix two issues observed on a virgin install
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Sep 2011 22:58:17 +0000 (22:58 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Sep 2011 22:58:17 +0000 (22:58 +0000)
modules/admin-full/luasrc/controller/admin/network.lua
modules/admin-full/luasrc/view/admin_network/iface_overview.htm

index e701d1db877e2d631bbe0b2b23ed244a7691fdec..d151a9a599e2a101cfe116890ac0ee83d952ee96 100644 (file)
@@ -247,7 +247,7 @@ function iface_status()
                                }
                        end
 
-                       for _, device in ipairs(net:get_interfaces()) do
+                       for _, device in ipairs(net:get_interfaces() or {}) do
                                data.subdevices[#data.subdevices+1] = {
                                        name       = device:shortname(),
                                        type       = device:type(),
index edfed7d7d2384a530254166fc7fbd00a37d59856..6a94c2dfe8bad769aa5dd81dceb435bc487aa16d 100644 (file)
@@ -74,9 +74,9 @@ $Id$
                        {
                                if (ifcs)
                                {
-                                       for (var i = 0; i < ifcs.length; i++)
+                                       for (var idx = 0; idx < ifcs.length; idx++)
                                        {
-                                               var ifc = ifcs[i];
+                                               var ifc = ifcs[idx];
                                                var html = '';
 
                                                var s = document.getElementById(ifc.id + '-ifc-devices');