summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-10-27 16:08:11 +0200
committerJo-Philipp Wich <jo@mein.io>2022-10-27 16:10:47 +0200
commit9af8486517e87eea837fbce0ce787fc89ab46627 (patch)
tree61450fe7ab76261231685c91aad661d0f897b45c /modules/luci-mod-network
parent4d6a2380987e9c9583fda44f2e48f925962ca99b (diff)
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 <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js2
1 files changed, 1 insertions, 1 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 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;
},