luci-base: network.js: fix deleteNetwork() implementation
authorJo-Philipp Wich <jo@mein.io>
Tue, 24 Sep 2019 06:02:57 +0000 (08:02 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 24 Sep 2019 06:02:57 +0000 (08:02 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/network.js

index 8432bd16f356a59fbed3a260761e749958ec67f3..a85e2414b660e4ed74caa3875968afac3d42055c 100644 (file)
@@ -822,7 +822,9 @@ Network = L.Class.extend({
        },
 
        deleteNetwork: function(name) {
-               return Promise.all([ L.require('firewall').catch(function() { return null }), initNetworkState() ]).then(function() {
+               var requireFirewall = Promise.resolve(L.require('firewall')).catch(function() {});
+
+               return Promise.all([ requireFirewall, initNetworkState() ]).then(function() {
                        var uciInterface = uci.get('network', name);
 
                        if (uciInterface != null && uciInterface['.type'] == 'interface') {