From: Jo-Philipp Wich Date: Thu, 30 Mar 2023 18:05:44 +0000 (+0200) Subject: application/luci-app-firewall: fix null access X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7a4afdcb05ad69fd9c0e39de9b44a59ad31130a7;p=project%2Fluci.git application/luci-app-firewall: fix null access 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 --- diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js index 66f50f799e..d7f70de517 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js @@ -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; diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js index 5dda8075a2..018554e991 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js @@ -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; diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js index 6ccb075569..9c3d5e7a31 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js @@ -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;