libs/uci: fix attempt to assign empty tables in uci bind class
This commit is contained in:
parent
f7ab20f6e3
commit
98187975f9
1 changed files with 5 additions and 1 deletions
|
@ -126,7 +126,11 @@ end
|
||||||
function bsection.set(self, k, v, c)
|
function bsection.set(self, k, v, c)
|
||||||
local stat
|
local stat
|
||||||
if type(c) == "string" then
|
if type(c) == "string" then
|
||||||
|
if type(v) == "table" and #v == 0 then
|
||||||
|
stat = self:uciop("delete", c, k)
|
||||||
|
else
|
||||||
stat = self:uciop("set", c, k, v)
|
stat = self:uciop("set", c, k, v)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self:uciop("foreach", self.stype,
|
self:uciop("foreach", self.stype,
|
||||||
function(s)
|
function(s)
|
||||||
|
|
Loading…
Reference in a new issue