From e666a94e534c1f30b45f99834cfdd39c7cf44f85 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 14 Nov 2023 21:51:22 +0000 Subject: [PATCH] fix: don't include ID on null user --- VPLink/Services/DiscordMessageService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/VPLink/Services/DiscordMessageService.cs b/VPLink/Services/DiscordMessageService.cs index 2230eaf..1022f57 100644 --- a/VPLink/Services/DiscordMessageService.cs +++ b/VPLink/Services/DiscordMessageService.cs @@ -65,7 +65,10 @@ internal sealed class DiscordMessageService : BackgroundService, IDiscordMessage var embed = new EmbedBuilder(); embed.WithColor(0xFF0000); - embed.WithDescription($"📤 **Avatar Left**: {avatar.Name} (User #{avatar.User.Id})"); + if (avatar.User is { } user) + embed.WithDescription($"📤 **Avatar Left**: {avatar.Name} (User #{user.Id})"); + else + embed.WithDescription($"📤 **Avatar Left**: {avatar.Name}"); return channel.SendMessageAsync(embed: embed.Build()); }