libs/web: handle empty tables in Map.set()
This commit is contained in:
parent
090ce4f17e
commit
6c84824d79
1 changed files with 7 additions and 3 deletions
|
@ -378,10 +378,14 @@ end
|
|||
|
||||
-- UCI set
|
||||
function Map.set(self, section, option, value)
|
||||
if option then
|
||||
return self.uci:set(self.config, section, option, value)
|
||||
if type(value) ~= "table" or #value > 0 then
|
||||
if option then
|
||||
return self.uci:set(self.config, section, option, value)
|
||||
else
|
||||
return self.uci:set(self.config, section, value)
|
||||
end
|
||||
else
|
||||
return self.uci:set(self.config, section, value)
|
||||
return Map.del(self, section, option)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue