Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Commit

Permalink
check getRatelimit callback before calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
Dakta authored and agentlame committed Jul 24, 2015
1 parent cc47ed0 commit d99a2fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tbutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1139,10 +1139,12 @@ function initwrapper() {
ratelimitReset = jqxhr.getResponseHeader('x-ratelimit-reset');
$.log('ratelimitRemaining: ' + ratelimitRemaining + ' ratelimitReset: ' + (ratelimitReset / 60), false, SHORTNAME);

callback({
'ratelimitRemaining': ratelimitRemaining,
'ratelimitReset': ratelimitReset
})
if (typeof callback !== "undefined") {
callback({
'ratelimitRemaining': ratelimitRemaining,
'ratelimitReset': ratelimitReset
});
}
});
};

Expand Down

0 comments on commit d99a2fd

Please sign in to comment.