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:
Darius 2018-09-26 10:59:08 +03:00 committed by Jo-Philipp Wich
parent f0141773ac
commit e5071c88f0

View file

@ -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)