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