From 1720a28af21bf5b00f242e27918bad5986d7b263 Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 8 Aug 2021 15:31:03 +0200 Subject: [PATCH] Fix system card lookup in DMs --- PluralKit.Bot/Services/EmbedService.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index 373e867f..4e2e3fb3 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -84,11 +84,15 @@ namespace PluralKit.Bot { if (system.Tag != null) eb.Field(new("Tag", system.Tag.EscapeMarkdown(), true)); - if (cctx.MessageContext.SystemGuildTag != null && cctx.MessageContext.TagEnabled) - eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", cctx.MessageContext.SystemGuildTag.EscapeMarkdown(), true)); + if (cctx.Guild != null) + { + if (cctx.MessageContext.SystemGuildTag != null && cctx.MessageContext.TagEnabled) + eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", cctx.MessageContext.SystemGuildTag + .EscapeMarkdown(), true)); - if (!cctx.MessageContext.TagEnabled) - eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", "*(tag is disabled in this server)*")); + if (!cctx.MessageContext.TagEnabled) + eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", "*(tag is disabled in this server)*")); + } if (!system.Color.EmptyOrNull()) eb.Field(new("Color", $"#{system.Color}", true));