fix undefined error in server

This commit is contained in:
jane 2021-06-06 00:17:59 -04:00
parent 0729cd9ee5
commit 7346a2d379
3 changed files with 4 additions and 1 deletions

View file

@ -69,7 +69,7 @@ function diff(current, checked) {
console.log(`split: ${split}`);
let index = filenames_checked.indexOf(split[0]);
console.log(`index: ${index}`);
if (index == -1) {
if (index == -1 || filenames_checked[index] == undefined) {
result += `${split[0]} download\n`;
continue;
}

View file

@ -60,6 +60,7 @@ local function getAllFiles()
local result = http.get(indexesUrl)
if result == nil then
print("error! getting indexes for " .. programToInstall)
error()
end
local resultText = result.readAll()
local resultTable = split(resultText, "\n")

View file

@ -64,6 +64,7 @@ local function getAllFiles()
local result = http.post(updateUrl, currentFiles)
if result == nil then
print("error! getting updates for " .. programToInstall)
error()
end
local resultText = result.readAll()
local resultTable = split(resultText, "\n")
@ -71,6 +72,7 @@ local function getAllFiles()
local result2 = http.get(indexesUrl)
if result2 == nil then
print("error! getting indexes for " .. programToInstall)
error()
end
local resultText2 = result2.readAll()
local resultTable2 = split(resultText2, "\n")