Browse Source

check_site: allow subcheck to be nil in need_table()

Nils Schneider 8 years ago
parent
commit
56e7753035
1 changed files with 4 additions and 2 deletions
  1. 4 2
      scripts/check_site_lib.lua

+ 4 - 2
scripts/check_site_lib.lua

@@ -84,8 +84,10 @@ function need_table(varname, subcheck, required)
 
    assert_type(var, 'table', "site.conf error: expected `" .. varname .. "' to be a table")
 
-   for k, v in pairs(var) do
-      subcheck(k, v)
+   if subcheck then
+      for k, v in pairs(var) do
+         subcheck(k, v)
+      end
    end
 
    return var