diff options
-rw-r--r-- | lbu-model.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lbu-model.lua b/lbu-model.lua index 1b9cd79..f3cd3b6 100644 --- a/lbu-model.lua +++ b/lbu-model.lua @@ -180,7 +180,7 @@ end local was_mounted local mnt local function mount() - local configopts = format.parse_ini_file(fs.read_file(configfile), "") or {} + local configopts = format.parse_ini_file(fs.read_file(configfile) or "", "") or {} mnt = "/media/"..configopts.LBU_MEDIA local f = io.popen("grep "..mnt.." /proc/mounts") local cmdresult = f:read("*a") @@ -243,7 +243,7 @@ function getconfig (configcontents) if configcontents then configopts = format.parse_ini_file(configcontents, "") or {} elseif (fs.is_file(configfile)) then - configopts = format.parse_ini_file(fs.read_file(configfile), "") or {} + configopts = format.parse_ini_file(fs.read_file(configfile) or "", "") or {} end config["LBU_MEDIA"] = cfe({ value=configopts.LBU_MEDIA or "", @@ -457,7 +457,7 @@ function getpackage() local package = cfe({ type="raw", label="error", option="application/x-gzip" }) for name in fs.find(".*tar%.gz", tmp) do package.label = basename(name) - package.value = fs.read_file(name) + package.value = fs.read_file(name) or "" break end |