From 3bcaaee1273cf9d50c77e26daf5e33b79a279fc8 Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Sun, 31 Mar 2024 23:40:43 +1100 Subject: [PATCH] fix: Handle null reference when Voice State is still in cache, but the channel it belongs to has been expired Fixes #1644 --- interactions/client/smart_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactions/client/smart_cache.py b/interactions/client/smart_cache.py index c84d7b8c7..bc7ab5b14 100644 --- a/interactions/client/smart_cache.py +++ b/interactions/client/smart_cache.py @@ -794,7 +794,7 @@ async def place_voice_state_data( if old_state := self.get_voice_state(user_id): # noinspection PyProtectedMember - if user_id in old_state.channel._voice_member_ids: + if old_state.channel is not None and user_id in old_state.channel._voice_member_ids: # noinspection PyProtectedMember old_state.channel._voice_member_ids.remove(user_id)