diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-01 20:48:18 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-01 20:48:18 +0000 |
commit | c230b83679568cd1fb0d52fa3f6a6b314564a1a7 (patch) | |
tree | 2fa2369893b3a7f495b06fb25c25befccb5e1263 /libs/uvl | |
parent | 06b6d23c20c8cb01923b7430739199b413926ec0 (diff) |
* luci/libs: uvl: fix possible "attempt to index field '?' (a nil value)" in uvl.uvlitem.config()
Diffstat (limited to 'libs/uvl')
-rw-r--r-- | libs/uvl/luasrc/uvl.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua index 66e7eeaea..082302837 100644 --- a/libs/uvl/luasrc/uvl.lua +++ b/libs/uvl/luasrc/uvl.lua @@ -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 |