libs/cbi: properly handle uvl errors without childs
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 29 Mar 2009 22:13:26 +0000 (22:13 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 29 Mar 2009 22:13:26 +0000 (22:13 +0000)
libs/cbi/luasrc/cbi.lua

index 4bed9b0..e7ad550 100644 (file)
@@ -166,7 +166,7 @@ local function _uvl_validate_section(node, name)
 
        local function tag_section(e)
                local s = { }
-               for _, c in ipairs(e.childs) do
+               for _, c in ipairs(e.childs or { e }) do
                        if c.childs and not c:is(luci.uvl.errors.ERR_DEPENDENCY) then
                                table.insert( s, c.childs[1]:string() )
                        else