luci-base: cbi.lua: fix TypedSection.parse()
It's not necessary to execute all code if section already exists. Signed-off-by: Darius Joksas <jok.darius@gmail.com> [reword commit message, squash commits, remove stray semicolon] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
f0141773ac
commit
e5071c88f0
1 changed files with 12 additions and 11 deletions
|
@ -1199,9 +1199,9 @@ function TypedSection.parse(self, novld)
|
|||
if name then
|
||||
-- Ignore if it already exists
|
||||
if self:cfgvalue(name) then
|
||||
name = nil;
|
||||
end
|
||||
|
||||
name = nil
|
||||
self.err_invalid = true
|
||||
else
|
||||
name = self:checkscope(name)
|
||||
|
||||
if not name then
|
||||
|
@ -1216,6 +1216,7 @@ function TypedSection.parse(self, novld)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if created then
|
||||
AbstractSection.parse_optionals(self, created)
|
||||
|
|
Loading…
Reference in a new issue