summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-10-15 18:42:04 +0200
committerJo-Philipp Wich <jo@mein.io>2019-10-15 18:42:04 +0200
commit9d80dbe635295991438b4ae3376b3ff0e8e415b0 (patch)
tree3f2f42d03cec1994198db431a329901633137ebe /modules/luci-mod-network/htdocs
parentf61d6ee14887a196c753753bc7eb290b12e5ce9e (diff)
luci-mod-network: wireless.js: fix null access on failing iwinfo calls
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
index e200e438a0..194b2a3df9 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
@@ -226,7 +226,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
'11a': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : []
};
- for (var i = 0; Array.isArray(data[1]) && i < data[1].length; i++)
+ for (var i = 0; i < data[1].length; i++)
this.channels[(data[1][i].mhz > 2484) ? '11a' : '11g'].push(
data[1][i].channel,
'%d (%d Mhz)'.format(data[1][i].channel, data[1][i].mhz),
@@ -286,7 +286,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
if (vals[i+2])
sel.add(E('option', { value: vals[i+0] }, [ vals[i+1] ]));
- if (!isNaN(vals.selected))
+ if (vals && !isNaN(vals.selected))
sel.selectedIndex = vals.selected;
sel.parentNode.style.display = (sel.options.length <= 1) ? 'none' : '';