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,11 +378,15 @@ end
|
||||||
|
|
||||||
-- UCI set
|
-- UCI set
|
||||||
function Map.set(self, section, option, value)
|
function Map.set(self, section, option, value)
|
||||||
|
if type(value) ~= "table" or #value > 0 then
|
||||||
if option then
|
if option then
|
||||||
return self.uci:set(self.config, section, option, value)
|
return self.uci:set(self.config, section, option, value)
|
||||||
else
|
else
|
||||||
return self.uci:set(self.config, section, value)
|
return self.uci:set(self.config, section, value)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
return Map.del(self, section, option)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- UCI del
|
-- UCI del
|
||||||
|
|
Loading…
Reference in a new issue