mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01: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:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user