From: Paul Donald Date: Wed, 26 Mar 2025 21:40:01 +0000 (+0100) Subject: luci-proto-wireguard: add extra checks for hostname when building qr X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=826883957d89f591ab5263b881501f3cb336c263;p=project%2Fluci.git luci-proto-wireguard: add extra checks for hostname when building qr Signed-off-by: Paul Donald (cherry picked from commit 4207c2c5d51470fd273441f92b0a2c104441454c) --- diff --git a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js index a3ce76c96c..603052f6c6 100644 --- a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js +++ b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js @@ -724,12 +724,12 @@ return network.registerProtocol('wireguard', { var hostnames = []; uci.sections('ddns', 'service', function(s) { - if (typeof(s.lookup_host) == 'string' && s.enabled == '1') + if (typeof(s?.lookup_host) == 'string' && s?.enabled == '1') hostnames.push(s.lookup_host); }); uci.sections('system', 'system', function(s) { - if (typeof(s.hostname) == 'string' && s.hostname.indexOf('.') > 0) + if (typeof(s?.hostname) == 'string' && s?.hostname?.indexOf('.') > 0) hostnames.push(s.hostname); });