Skip to content

Commit c5bd818

Browse files
authored
Fix http.download
1 parent 7fe0957 commit c5bd818

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

AUTOPLUG2/git/updater.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ function screen.flip()
5454
return 1;
5555
end
5656

57-
if http.download(url, path2vpk).success then
57+
local res = http.download(url, path2vpk)
58+
if res and res.success then
5859
os.delay(500)
5960
if files.exists(path2vpk) then
6061
files.mkdir("ux0:/data/1luapkg")
@@ -67,6 +68,9 @@ function screen.flip()
6768
files.delete("ux0:/data/1luapkg")
6869
game.launch(string.format("ONEUPDATE&%s&%s&%s&%s", os.titleid(), path2vpk, files.cdir().."/lang/", __LANG)) -- Goto installer extern!
6970
end
71+
else
72+
files.delete(path2vpk)
73+
os.message(LANGUAGE["UPDATER_ERROR"])
7074
end
7175
onAppInstall = onAppInstallOld
7276
onNetGetFile = onNetGetFileOld

0 commit comments

Comments
 (0)