Skip to content

Commit

Permalink
Fixed nullref when posting displays without footers
Browse files Browse the repository at this point in the history
  • Loading branch information
MonzUn committed Sep 13, 2024
1 parent 28d5dbd commit 6eff548
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DiscordLink/Source/Utilities/MessageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static List<DiscordEmbed> BuildDiscordEmbeds(DiscordLinkEmbed fullEmbed)
DiscordLinkEmbed splitEmbedBuilder = new DiscordLinkEmbed(fullEmbed);
splitEmbedBuilder.WithFooter(string.Empty); // Remove the footer for now, we will add it back at the end
splitEmbedBuilder.ClearFields();
int embedTitleAndFooterSize = fullEmbed.Title.Length + partCountCharactersMax + fullEmbed.Footer.Length;
int embedTitleAndFooterSize = fullEmbed.Title.Length + partCountCharactersMax + (fullEmbed.Footer?.Length ?? 0);
int characterCount = 0;
int fieldCount = 0;
foreach (DiscordLinkEmbedField field in splitFields)
Expand Down

0 comments on commit 6eff548

Please sign in to comment.