diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index 39e85a37..e49e56e1 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -75,7 +75,7 @@ public class EmbedService if (system.Tag != null) headerText += $"\n**Tag:** {system.Tag.EscapeMarkdown()}"; - if (cctx.Config.CardShowColorHex && !system.Color.EmptyOrNull()) + if (cctx.Config != null && cctx.Config.CardShowColorHex && !system.Color.EmptyOrNull()) headerText += $"\n**Color:** #{system.Color}"; if (cctx.Guild != null) @@ -361,7 +361,7 @@ public class EmbedService headerText += $"\n**Display name:** {member.DisplayName.Truncate(1024)}"; if (guild != null && guildDisplayName != null) headerText += $"\n**Server nickname (for '{guild.Name}'):** {guildDisplayName.Truncate(1024)}"; - if (ccfg.CardShowColorHex && !member.Color.EmptyOrNull()) + if (ccfg != null && ccfg.CardShowColorHex && !member.Color.EmptyOrNull()) headerText += $"\n**Color:** #{member.Color}"; if (member.PronounsFor(ctx) is { } pronouns && !string.IsNullOrWhiteSpace(pronouns)) headerText += $"\n**Pronouns:** {pronouns}"; @@ -582,7 +582,7 @@ public class EmbedService if (target.NamePrivacy.CanAccess(pctx) && target.DisplayName != null) headerText += $"\n**Display name:** {target.DisplayName}"; - if (ctx.Config.CardShowColorHex && !target.Color.EmptyOrNull()) + if (ctx.Config != null && ctx.Config.CardShowColorHex && !target.Color.EmptyOrNull()) headerText += $"\n**Color:** #{target.Color}"; if (target.ListPrivacy.CanAccess(pctx))