diff options
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) |