luci-mod-network: dhcp.js: don't fail on not existing interface
authorJo-Philipp Wich <jo@mein.io>
Thu, 8 Jul 2021 16:55:47 +0000 (18:55 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 8 Jul 2021 16:56:23 +0000 (18:56 +0200)
Fixes: #5177
Fixes: 7e56289538 ("luci-mod-network: improve static DHCP lease validation")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index d8083a1e0ead070c75eb09d0dcaa3559dd5cfbcf..cb1aa994725af43e49a509fdf585a4ff8824c65d 100644 (file)
@@ -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({