Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
fix: handle guild not existing in the cache (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
LordOfPolls committed Sep 3, 2022
1 parent 89b0e0e commit 97acbb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion naff/client/smart_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def delete_member(self, guild_id: "Snowflake_Type", user_id: "Snowflake_Type") -
guild_id = to_snowflake(guild_id)

if member := self.member_cache.pop((guild_id, user_id), None):
member.guild._member_ids.discard(user_id)
if member.guild:
member.guild._member_ids.discard(user_id)

self.delete_user_guild(user_id, guild_id)

Expand Down

0 comments on commit 97acbb1

Please sign in to comment.