diff --git a/api/services/Reddit.js b/api/services/Reddit.js index c20118ac..28c0124b 100644 --- a/api/services/Reddit.js +++ b/api/services/Reddit.js @@ -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"); }