summaryrefslogtreecommitdiffstats
path: root/openntpd-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openntpd-model.lua')
-rw-r--r--openntpd-model.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/openntpd-model.lua b/openntpd-model.lua
index 3869ee9..b5405b9 100644
--- a/openntpd-model.lua
+++ b/openntpd-model.lua
@@ -22,7 +22,7 @@ local function config_content( f )
local config = {}
config.name = f
local conf_file = fs.read_file_as_array ( config.name )
- for i=1,table.maxn(conf_file) do
+ for i=1,table.maxn((conf_file or {})) do
local l = conf_file[i]
-- Filter out commented lines
if not string.find ( l, "^[;#].*" ) then
@@ -239,7 +239,7 @@ end
function getconfig ()
local path = configfile
local config = {}
- local configopts = getopts.getoptsfromfile(confdfile, "")
+ local configopts = getopts.getoptsfromfile(confdfile, "") or {}
configopts["variables"] = config_content(path)