* luci/libs: uvl: fix possible "attempt to index field '?' (a nil value)" in uvl.uvlitem.config()
This commit is contained in:
parent
06b6d23c20
commit
c230b83679
1 changed files with 3 additions and 2 deletions
|
@ -777,9 +777,10 @@ function uvlitem.config(self, opt)
|
||||||
local c
|
local c
|
||||||
|
|
||||||
if #self.cref == 4 or #self.cref == 3 then
|
if #self.cref == 4 or #self.cref == 3 then
|
||||||
c = self.c[self.cref[2]][self.cref[3]]
|
c = self.c and self.c[self.cref[2]] or nil
|
||||||
|
c = c and c[self.cref[3]] or nil
|
||||||
elseif #self.cref == 2 then
|
elseif #self.cref == 2 then
|
||||||
c = self.c[self.cref[2]]
|
c = self.c and self.c[self.cref[2]] or nil
|
||||||
else
|
else
|
||||||
c = self.c
|
c = self.c
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue