* luci/libs: uvl: fix possible "attempt to index field '?' (a nil value)" in uvl.uvlitem.config()

This commit is contained in:
Jo-Philipp Wich 2008-09-01 20:48:18 +00:00
parent 06b6d23c20
commit c230b83679

View file

@ -777,9 +777,10 @@ function uvlitem.config(self, opt)
local c
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
c = self.c[self.cref[2]]
c = self.c and self.c[self.cref[2]] or nil
else
c = self.c
end