From ec5107bd9061700219bb7e4d93c90a40626a70c5 Mon Sep 17 00:00:00 2001 From: Proddy Date: Fri, 3 Jun 2022 01:54:47 +0100 Subject: [PATCH] Update EmbedBuilder.cs Fixed an incorrect assuption that `Value` was a `string?` --- src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs b/src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs index 0089b9a71..8af2cc592 100644 --- a/src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs +++ b/src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs @@ -150,7 +150,7 @@ namespace Discord int authorLength = Author?.Name?.Length ?? 0; int descriptionLength = Description?.Length ?? 0; int footerLength = Footer?.Text?.Length ?? 0; - int fieldSum = Fields.Sum(f => f.Name.Length + (string.IsNullOrEmpty(f.Value) ? 0 : f.Value.ToString().Length)); + int fieldSum = Fields.Sum(f => f.Name.Length + (f.Value == null ? 0 : f.Value.ToString().Length)); return titleLength + authorLength + descriptionLength + footerLength + fieldSum; }