Skip to content

Commit

Permalink
Merge pull request #371 from not-an-aardvark/master
Browse files Browse the repository at this point in the history
Fix Reddit.js error
  • Loading branch information
AlMcKinlay committed Nov 3, 2015
2 parents 2cda889 + 4e4db82 commit 39070c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/services/Reddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ exports.checkModeratorStatus = function (refreshToken, username, subreddit, call
};

var updateRateLimits = function (res) {
if (res.headers['x-ratelimit-remaining'] && res.headers['x-ratelimit-reset']) {
if (res && res.headers && res.headers['x-ratelimit-remaining'] && res.headers['x-ratelimit-reset']) {
left = res.headers['x-ratelimit-remaining'];
resetTime = moment().add(res.headers['x-ratelimit-reset'], "seconds");
}
Expand Down

0 comments on commit 39070c8

Please sign in to comment.