From 9af8486517e87eea837fbce0ce787fc89ab46627 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 27 Oct 2022 16:08:11 +0200 Subject: luci-mod-network: gracefully handle empty channel lists Avoid undefined value access when the channel list is empty. Fixes: #5937, #5951 Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/view/network/wireless.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') 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 e5e2173462..dec4586268 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 @@ -480,7 +480,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ this.toggleWifiBand(elem); bwdt.value = htval; - chan.value = chval || chan.options[0].value; + chan.value = chval || (chan.options[0] ? chan.options[0].value : 'auto'); return elem; }, -- cgit v1.2.3