Skip to content

Commit

Permalink
handle undefined body from request.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Feb 11, 2013
1 parent 1ed8237 commit af1db33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/charged.js
Expand Up @@ -910,6 +910,10 @@ Charged.prototype.request = function(options, callback) {
+ ' Chargify may be having a problem.')); + ' Chargify may be having a problem.'));
} }


if (!body) {
return callback(new Error('No body.'));
}

if (body.errors) { if (body.errors) {
return callback(new Error(body.errors.join('\n'))); return callback(new Error(body.errors.join('\n')));
} }
Expand Down

0 comments on commit af1db33

Please sign in to comment.