From: Jo-Philipp Wich Date: Tue, 15 Oct 2019 16:42:04 +0000 (+0200) Subject: luci-mod-network: wireless.js: fix null access on failing iwinfo calls X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9d80dbe635295991438b4ae3376b3ff0e8e415b0;p=oweals%2Fluci.git luci-mod-network: wireless.js: fix null access on failing iwinfo calls Signed-off-by: Jo-Philipp Wich --- 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 e200e438a..194b2a3df 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' : '';