luci-mod-network: wireless.js: fix null access on unavailable country list
authorJo-Philipp Wich <jo@mein.io>
Tue, 15 Oct 2019 08:03:48 +0000 (10:03 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 15 Oct 2019 08:03:48 +0000 (10:03 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index c9f5957f8ecd0fc185ef96a5e1da21b25cbb5fb0..e200e438a0fd7b0fc108f5889e46d8d898300000 100644 (file)
@@ -483,7 +483,7 @@ var CBIWifiCountryValue = form.Value.extend({
        },
 
        renderWidget: function(section_id, option_index, cfgvalue) {
-               var typeClass = this.keylist.length ? form.ListValue : form.Value;
+               var typeClass = (this.keylist && this.keylist.length) ? form.ListValue : form.Value;
                return typeClass.prototype.renderWidget.apply(this, [section_id, option_index, cfgvalue]);
        }
 });