summaryrefslogtreecommitdiffstats
path: root/tinydns-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r--tinydns-model.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua
index b17f8e2..0fa92f1 100644
--- a/tinydns-model.lua
+++ b/tinydns-model.lua
@@ -52,7 +52,7 @@ local descr = {
-- Commented/Blank lines are ignored
local function get_value_from_file(file)
local output = {}
- local filecontent = fs.read_file_as_array(file)
+ local filecontent = fs.read_file_as_array(file) or {}
for i=1,table.maxn(filecontent) do
local l = filecontent[i]
if not (string.find ( l, "^[;#].*" )) and not (string.find (l, "^%s*$")) then
@@ -168,7 +168,7 @@ end
function getconfig()
local config = {}
- local listenaddr = format.parse_ini_file(fs.read_file(configfile),"","IP") or ""
+ local listenaddr = format.parse_ini_file(fs.read_file(configfile) or "","","IP") or ""
config.listen = cfe({
label="IP address to listen on",
value=listenaddr,
@@ -201,7 +201,7 @@ function getconfigobjects(self, file_name, userid, filter_type)
--Loop through all available configfiles
for i,filename in pairs(configfiles) do
if not file_name or file_name == filename then
- local filecontent = fs.read_file_as_array(filename)
+ local filecontent = fs.read_file_as_array(filename) or {}
for linenumber,configline in ipairs(filecontent) do
local domaindetails = {}
local filecontent_table = split_config_items(configline)