luci-proto-wireguard: gracefully deal with missing uci configs

The /etc/config/ddns in particular might not be present on the system,
don't fail if it is absent.

Fixes: #5838
Fixes: 9ba20645b0 ("luci-proto-wireguard: rewrite protocol handler")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2022-06-21 00:07:04 +02:00
parent 4769bf11aa
commit 340183786e

View file

@ -686,8 +686,8 @@ return network.registerProtocol('wireguard', {
return Promise.all([
network.getWANNetworks(),
network.getWAN6Networks(),
uci.load('ddns'),
uci.load('system'),
L.resolveDefault(uci.load('ddns')),
L.resolveDefault(uci.load('system')),
parent.save(null, true)
]).then(function(data) {
var hostnames = [];