diff options
author | Hisham <hisham@gobolinux.org> | 2016-07-14 14:27:46 -0300 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-07-14 14:27:46 -0300 |
commit | 0f63a95e991435c769584abd01b16bd748a1434b (patch) | |
tree | 1816bfd89d5a1260ae46fa7f37e421d3fb392da2 /src | |
parent | 187f0dee0b77e1f09c9881ac63e4d8b2cd2fd9c8 (diff) | |
download | luarocks-0f63a95e991435c769584abd01b16bd748a1434b.tar.gz luarocks-0f63a95e991435c769584abd01b16bd748a1434b.tar.bz2 luarocks-0f63a95e991435c769584abd01b16bd748a1434b.zip |
Check for invalid server response.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/upload.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/luarocks/upload.lua b/src/luarocks/upload.lua index 3adc1704..7c0c416c 100644 --- a/src/luarocks/upload.lua +++ b/src/luarocks/upload.lua | |||
@@ -76,6 +76,9 @@ function upload.command(flags, fname) | |||
76 | local module_url = res.module_url | 76 | local module_url = res.module_url |
77 | 77 | ||
78 | if rock_fname then | 78 | if rock_fname then |
79 | if (not res.version) or (not res.version.id) then | ||
80 | return nil, "Invalid response from server." | ||
81 | end | ||
79 | util.printout(("Sending " .. tostring(rock_fname) .. " ...")) | 82 | util.printout(("Sending " .. tostring(rock_fname) .. " ...")) |
80 | res, err = api:method("upload_rock/" .. ("%d"):format(res.version.id), nil, { | 83 | res, err = api:method("upload_rock/" .. ("%d"):format(res.version.id), nil, { |
81 | rock_file = multipart.new_file(rock_fname) | 84 | rock_file = multipart.new_file(rock_fname) |