modules/admin-full: prevent crash in wifi model if no tx power list is available
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 26 Sep 2009 18:53:01 +0000 (18:53 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 26 Sep 2009 18:53:01 +0000 (18:53 +0000)
modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua

index 613319b..63c2344 100644 (file)
@@ -25,8 +25,8 @@ local tx_powers = nil
 
 m.uci:foreach("wireless", "wifi-iface",
        function(s)
-               if s.device == arg[1] and s.ifname and not iw then
-                       iw = luci.sys.wifi.getiwinfo(s.ifname)
+               if s.device == arg[1] and not iw then
+                       iw = luci.sys.wifi.getiwinfo(s.ifname or s.device)
                        tx_powers = iw.txpwrlist or { }
                end
        end)