Skip to content

Commit

Permalink
Merge pull request kaimallea#28 from Dcard-Fork/master
Browse files Browse the repository at this point in the history
fix error cause by sometimes body return without data attributes
  • Loading branch information
kaimallea authored Nov 18, 2016
2 parents ed9b53d + d7d7f85 commit 5343305
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 @@ -96,7 +96,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 5343305

Please sign in to comment.