Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix problems with errors on DELETE commands
Browse files Browse the repository at this point in the history
DELETEs would return empty bodies, which would cause errors here
  • Loading branch information
swang committed Oct 18, 2013
1 parent de8ec62 commit b50829c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Abstract.prototype.request = function(method, uri) {
this.req(options, function(err, resp, body) {
if (err) { return callback(err) }

if (body.status >= 400) {
if (body && body.status >= 400) {
if (_this.statusCodes && _this.statusCodes[body.status]) {
return callback({ status: body.status, message: _this.statusCodes[body.status].message })
}
Expand Down

0 comments on commit b50829c

Please sign in to comment.