mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 15:11:32 +00:00
Fix data undefined error (#502)
This commit is contained in:
parent
d656c68e75
commit
8085f5bde3
2 changed files with 2 additions and 2 deletions
|
|
@ -177,7 +177,7 @@ var InternalClient = (function () {
|
|||
ret.set('User-Agent', self.userAgentInfo.full);
|
||||
ret.end(function (error, data) {
|
||||
if (error) {
|
||||
if (data.status === 429) {
|
||||
if (data && data.status === 429) {
|
||||
self.client.emit("debug", "Encountered 429 at " + url + " | " + self.client.options.shard + " | Buckets" + buckets + " | " + (Date.now() - startTime) + "ms latency");
|
||||
}
|
||||
reject(error);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ export default class InternalClient {
|
|||
ret.set('User-Agent', self.userAgentInfo.full);
|
||||
ret.end((error, data) => {
|
||||
if (error) {
|
||||
if(data.status === 429) {
|
||||
if (data && data.status === 429) {
|
||||
self.client.emit("debug", "Encountered 429 at " + url + " | " + self.client.options.shard + " | Buckets" + buckets + " | " + (Date.now() - startTime) + "ms latency");
|
||||
}
|
||||
reject(error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue