From f57d20bffffda026ab203d328a859a3f38c0c8d0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 8 Jul 2021 18:55:47 +0200 Subject: [PATCH] luci-mod-network: dhcp.js: don't fail on not existing interface Fixes: #5177 Fixes: 7e56289538 ("luci-mod-network: improve static DHCP lease validation") Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/view/network/dhcp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index d8083a1e0e..cb1aa99472 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -98,9 +98,9 @@ function getDHCPPools() { continue; tasks.push(network.getNetwork(sections[i].interface).then(L.bind(function(section_id, net) { - var cidr = (net.getIPAddrs()[0] || '').split('/'); + var cidr = net ? (net.getIPAddrs()[0] || '').split('/') : null; - if (cidr.length == 2) { + if (cidr && cidr.length == 2) { var net_mask = calculateNetwork(cidr[0], cidr[1]); pools.push({ -- 2.30.2