application/luci-app-firewall: fix null access
authorJo-Philipp Wich <jo@mein.io>
Thu, 30 Mar 2023 18:05:44 +0000 (20:05 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 3 Apr 2023 11:51:44 +0000 (13:51 +0200)
Fixes: 48086e1c7b ("luci-app-firewall: Add ipset field to snats")
Fixes: d0d891c23e ("luci-app-firewall: Add ipset field to forwards (redirects)")
Fixes: f407a013ba ("luci-app-firewall: Add ipset field to rules")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7a4afdcb05ad69fd9c0e39de9b44a59ad31130a7)

applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js

index 66f50f799eb03f20bd3a6531d18dc0cc4ee5400d..d7f70de517f7fe30e0bbdd3c2a5961577f88cbf9 100644 (file)
@@ -243,7 +243,7 @@ return view.extend({
                o = s.taboption('advanced', form.Value, 'ipset', _('Use ipset'));
                uci.sections('firewall', 'ipset', function(s) {
                        if (typeof(s.name) == 'string')
-                               this.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
+                               o.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
                });
                o.modalonly = true;
                o.rmempty = true;
index 5dda8075a2e92c307925f98ce43b73e766f49478..018554e991b90a4d13e414598161d9be1e56be25 100644 (file)
@@ -374,7 +374,7 @@ return view.extend({
                o = s.taboption('advanced', form.Value, 'ipset', _('Use ipset'));
                uci.sections('firewall', 'ipset', function(s) {
                        if (typeof(s.name) == 'string')
-                               this.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
+                               o.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
                });
                o.modalonly = true;
                o.rmempty = true;
index 6ccb07556904fd98a630c3065a1184b25e1296ba..9c3d5e7a31f6f4f7f0a016531ea5db470d904ac1 100644 (file)
@@ -318,7 +318,7 @@ return view.extend({
                        o = s.taboption('advanced', form.Value, 'ipset', _('Use ipset'));
                        uci.sections('firewall', 'ipset', function(s) {
                                if (typeof(s.name) == 'string')
-                                       this.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
+                                       o.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
                        });
                        o.modalonly = true;
                        o.rmempty = true;