From 9d80dbe635295991438b4ae3376b3ff0e8e415b0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 15 Oct 2019 18:42:04 +0200 Subject: [PATCH] luci-mod-network: wireless.js: fix null access on failing iwinfo calls Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/view/network/wireless.js | 4 ++-- 1 file 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' : ''; -- 2.30.2