diff --git a/projects/updater/install.lua b/projects/updater/install.lua index e8150b8..3a64684 100644 --- a/projects/updater/install.lua +++ b/projects/updater/install.lua @@ -85,6 +85,10 @@ local function getAllFiles(program) end local function finishInstall(program, files) + if files == nil then + print("files var is nil") + error() + end for key, file in ipairs(files) do if customPath ~= nil then print("moving " .. file .. " to " .. customPath .. "...") diff --git a/projects/updater/update.lua b/projects/updater/update.lua index cc785fc..b8fbdbd 100644 --- a/projects/updater/update.lua +++ b/projects/updater/update.lua @@ -104,7 +104,11 @@ local function getAllFiles(program) end local function finishInstall(program, files) - for key, file in ipairs(files) do + if files == nil then + print("files var is nil") + error() + end + for _, file in ipairs(files) do if customPath ~= nil then print("moving " .. file .. " to " .. customPath .. "...") if not fs.exists(customPath) then @@ -145,13 +149,16 @@ if programToInstall == nil then if value ~= "" and value ~= nil then print("checking for updates for " .. value) local files = getAllFiles(value) - if files ~= nil then + + if #files == 0 then + print("no updates found.") + elseif files ~= nil then for _, value2 in ipairs(files) do if value2 ~= nil then downloadFile(value, value2) end end - finishInstall(files) + finishInstall(value, files) end end end