mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): resolve NRE on querying CV2 cards
This commit is contained in:
parent
ccbc027729
commit
a55ccdceea
1 changed files with 3 additions and 3 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue