diff options
| author | Jo-Philipp Wich <jow@openwrt.org> | 2016-01-15 14:13:44 +0100 |
|---|---|---|
| committer | Jo-Philipp Wich <jow@openwrt.org> | 2016-01-18 10:18:02 +0100 |
| commit | 31cfd4df4ce1eb651100c351235de9afadea1978 (patch) | |
| tree | 678553e1fa4f3f96c7252e2c7b9480ceb97f8958 /modules | |
| parent | 956be556711fa40697d4b63c3acb8f3dd5fa5c74 (diff) | |
luci-mod-admin-full: avoid indexing iw.hwmodelist directly
Prevent a nil field access when hwmodelist is undefined.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua index 9a2bd5d201..c024164b88 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua @@ -160,7 +160,7 @@ if found_sta then found_sta.channel, table.concat(found_sta.names, ", ")) else ch = s:taboption("general", Value, "_mode_freq", '<br />'..translate("Operating frequency")) - ch.hwmodes = iw.hwmodelist + ch.hwmodes = hw_modes ch.freqlist = iw.freqlist ch.template = "cbi/wireless_modefreq" @@ -174,7 +174,7 @@ else function ch.formvalue(self, section) return { - m:formvalue(self:cbid(section) .. ".band") or (iw.hwmodelist.g and "11g" or "11a"), + m:formvalue(self:cbid(section) .. ".band") or (hw_modes.g and "11g" or "11a"), m:formvalue(self:cbid(section) .. ".channel") or "auto", m:formvalue(self:cbid(section) .. ".htmode") or "" } |
