diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2014-02-14 13:37:48 -0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-02-14 13:37:48 -0200 |
| commit | 506a5397be6157b3e303ce86f51610f4fb6f02df (patch) | |
| tree | 86ab4426575049dacf28ab768f7158d8593e8536 | |
| parent | 2f23df7e40e5750148d0e619f8d1a314e594ccc9 (diff) | |
| parent | b5259bcca17f601060d2d2e3abdc68646b7cf256 (diff) | |
| download | luarocks-506a5397be6157b3e303ce86f51610f4fb6f02df.tar.gz luarocks-506a5397be6157b3e303ce86f51610f4fb6f02df.tar.bz2 luarocks-506a5397be6157b3e303ce86f51610f4fb6f02df.zip | |
Merge pull request #233 from neomantra/http_request_err
Added nil check for tsfd in http_request()
| -rw-r--r-- | src/luarocks/fs/lua.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index a95e7c51..ea16b728 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
| @@ -611,8 +611,10 @@ local function http_request(url, http, cached) | |||
| 611 | if result then | 611 | if result then |
| 612 | if cached and headers["last-modified"] then | 612 | if cached and headers["last-modified"] then |
| 613 | local tsfd = io.open(cached..".timestamp", "w") | 613 | local tsfd = io.open(cached..".timestamp", "w") |
| 614 | tsfd:write(headers["last-modified"]) | 614 | if tsfd then |
| 615 | tsfd:close() | 615 | tsfd:write(headers["last-modified"]) |
| 616 | tsfd:close() | ||
| 617 | end | ||
| 616 | end | 618 | end |
| 617 | return table.concat(result) | 619 | return table.concat(result) |
| 618 | else | 620 | else |
