0
0
mirror of https://github.com/openwrt/luci.git synced 2025-04-02 02:29:00 +00:00

luci-proto-wireguard: add extra checks for hostname when building qr

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2025-03-26 22:40:01 +01:00
parent 9c94c7dc93
commit 4207c2c5d5

@ -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);
});