luci-base: firewall.js: fix addZone()
authorJo-Philipp Wich <jo@mein.io>
Wed, 14 Aug 2019 15:04:45 +0000 (17:04 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 14 Aug 2019 20:58:15 +0000 (22:58 +0200)
When checking for an existing zone with the same name internally,
addZone() must use the nonblocking lookupZone() instead of the
promise returning public getZone() call.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/firewall.js

index 9ae14e16d9910d77c4c9e58d71698a2620f74ac9..8f6be1813dc85c50a8791a0afe75f2c20fe52f75 100644 (file)
@@ -99,7 +99,7 @@ Firewall = L.Class.extend({
                        if (name == null || !/^[a-zA-Z0-9_]+$/.test(name))
                                return null;
 
-                       if (this.getZone(name) != null)
+                       if (lookupZone(name) != null)
                                return null;
 
                        var d = new Defaults(),