From 0d7e809ef63026b18ada93ed271c1f2aad7f7381 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 13 Dec 2024 14:39:51 +0100 Subject: [PATCH] fix: fall back to default log channel if the queried channel isn't in cache --- .../Services/WebhookExecutorService.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Catalogger.Backend/Services/WebhookExecutorService.cs b/Catalogger.Backend/Services/WebhookExecutorService.cs index 78f12f5..6b73cb4 100644 --- a/Catalogger.Backend/Services/WebhookExecutorService.cs +++ b/Catalogger.Backend/Services/WebhookExecutorService.cs @@ -323,7 +323,13 @@ public class WebhookExecutorService( ); if (!channelCache.TryGet(channelId, out var channel)) + { + _logger.Verbose( + "Channel with ID {ChannelId} is not cached, returning default log channel", + channelId + ); return GetDefaultLogChannel(guild, logChannelType); + } Snowflake? categoryId; if ( @@ -401,7 +407,13 @@ public class WebhookExecutorService( } if (!channelCache.TryGet(channelId.Value, out var channel)) - return null; + { + _logger.Verbose( + "Channel with ID {ChannelId} is not cached, returning default log channel", + channelId + ); + return GetDefaultLogChannel(guild, logChannelType); + } Snowflake? categoryId; if (