Skip to content

Commit

Permalink
fix error cause by sometimes body return without data attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
kytu800 committed Dec 27, 2015
1 parent 1f68c8d commit d7d7f85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/imgur.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ imgur._imgurRequest = function (operation, payload, extraFormParams) {
if (err) {
deferred.reject(err);
} else if (!body.success) {
deferred.reject({status: body.status, message: body.data.error});
deferred.reject({status: body.status, message: body.data ? body.data.error : 'No body data response'});
} else {
deferred.resolve(body);
}
Expand Down

0 comments on commit d7d7f85

Please sign in to comment.