add null checks

This commit is contained in:
jane 2021-06-06 00:45:52 -04:00
parent e026e44e52
commit 7c34250e35

View file

@ -140,12 +140,17 @@ if programToInstall == nil then
local programsText = programsFile.readAll() local programsText = programsFile.readAll()
local programsTable = split(programsText, "\n") local programsTable = split(programsText, "\n")
for _, value in ipairs(programsTable) do for _, value in ipairs(programsTable) do
if value ~= "" and value ~= nil then
print("checking for updates for " .. value)
local files = getAllFiles(value) local files = getAllFiles(value)
if files ~= nil then
for _, value2 in ipairs(files) do for _, value2 in ipairs(files) do
downloadFile(value, value2) downloadFile(value, value2)
end end
finishInstall(files) finishInstall(files)
end end
end
end
else else
print("getting updates for " .. programToInstall .. "...") print("getting updates for " .. programToInstall .. "...")
local files = getAllFiles(programToInstall) local files = getAllFiles(programToInstall)