mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
src(WebSocket): fix race condition (#3636)
A race condition caused Client#user to be null in the ready event if the client handled 0 guilds.
This commit is contained in:
parent
b4f00bfb6b
commit
710101c580
2 changed files with 2 additions and 1 deletions
|
|
@ -373,7 +373,6 @@ class WebSocketShard extends EventEmitter {
|
|||
this.debug(`[READY] Session ${this.sessionID}.`);
|
||||
this.lastHeartbeatAcked = true;
|
||||
this.sendHeartbeat('ReadyHeartbeat');
|
||||
this.checkReady();
|
||||
break;
|
||||
case WSEvents.RESUMED: {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,4 +16,6 @@ module.exports = (client, { d: data }, shard) => {
|
|||
guild.shardID = shard.id;
|
||||
client.guilds.add(guild);
|
||||
}
|
||||
|
||||
shard.checkReady();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue