From 2b046afec8e665543be34e1290850d65371036b3 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 7 Jan 2025 08:34:41 +0100 Subject: [PATCH] fix: :bug: fix a rare crash on EVENTS_CACHE --- divent/bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/divent/bot.py b/divent/bot.py index 834e6ac..00e018f 100644 --- a/divent/bot.py +++ b/divent/bot.py @@ -332,7 +332,10 @@ async def ical(entity_id: str): for guild in client.guilds: for scheduled_event in guild.scheduled_events: - if user.id in EVENTS_CACHE[scheduled_event.id]: + if ( + scheduled_event.id in EVENTS_CACHE + and user.id in EVENTS_CACHE[scheduled_event.id] + ): event = make_event(scheduled_event) calendar.events.append(event)