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:
Jacob Morrison 2024-01-22 08:17:23 -05:00 committed by GitHub
parent f48787eef1
commit fed7f341be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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