mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 12:04:42 +12:00
Skip sweeping if the guild is not available (#10070)
* Skip sweeping if the guild is not available * Typo * Fix formatting * Fix lint * Check if key in guild * Bwck to guild a ailable --------- Co-authored-by: Jake Morrison <jake.morrison@pinnsg.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
f48787eef1
commit
fed7f341be
1 changed files with 3 additions and 0 deletions
|
@ -425,6 +425,9 @@ class Sweepers {
|
|||
let items = 0;
|
||||
|
||||
for (const guild of this.client.guilds.cache.values()) {
|
||||
// We may be unable to sweep the cache if the guild is unavailable and was never patched
|
||||
if (!guild.available) continue;
|
||||
|
||||
const { cache } = guild[key];
|
||||
|
||||
guilds++;
|
||||
|
|
Loading…
Reference in a new issue