summaryrefslogtreecommitdiffhomepage
path: root/libs/uvl/luasrc/uvl.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-08-17 23:40:51 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-08-17 23:40:51 +0000
commitd0cbcfa45826b96d36522b8055ce0ba994a0879d (patch)
treeae12196c90b2d946fababadf9c9b7dfa454bc15c /libs/uvl/luasrc/uvl.lua
parent6d5efc7925f8abf7ab64ad76b0a70ddfb8d21a93 (diff)
* luci/libs: further fixes in uvl cli and library
Diffstat (limited to 'libs/uvl/luasrc/uvl.lua')
-rw-r--r--libs/uvl/luasrc/uvl.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua
index b3701b17ec..85962b402b 100644
--- a/libs/uvl/luasrc/uvl.lua
+++ b/libs/uvl/luasrc/uvl.lua
@@ -110,6 +110,10 @@ function UVL.validate_config( self, config )
local co = self.uci.get_all( config )
local sc = { }
+ if not co then
+ return false, 'Unable to load configuration "' .. config .. '"'
+ end
+
local function _uci_foreach( type, func )
local ok, err
for k, v in pairs(co) do
@@ -179,6 +183,11 @@ function UVL.validate_section( self, config, section )
self.beenthere = { }
local co = self.uci.get_all( config )
+
+ if not co then
+ return false, 'Unable to load configuration "' .. config .. '"'
+ end
+
if co[section] then
return self:_validate_section( luci.uvl.section(
self, co, co[section]['.type'], config, section
@@ -208,6 +217,11 @@ function UVL.validate_option( self, config, section, option )
self.beenthere = { }
local co = self.uci.get_all( config )
+
+ if not co then
+ return false, 'Unable to load configuration "' .. config .. '"'
+ end
+
if co[section] and co[section][option] then
return self:_validate_option( luci.uvl.option(
self, co, co[section]['.type'], config, section, option