Fix data undefined error (#502)

This commit is contained in:
Manuel Kraus
2016-08-07 01:08:23 +02:00
committed by abal
parent d656c68e75
commit 8085f5bde3
2 changed files with 2 additions and 2 deletions

View File

@@ -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);