From 5cb95cf94d7b49622f583f1ef30890ddc0311b5e Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 1 May 2022 19:20:48 +0200 Subject: [PATCH] Fixed an issue with embed array not building if the color is invalid or unspecified --- src/NadekoBot/Common/SmartText/SmartEmbedText.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Common/SmartText/SmartEmbedText.cs b/src/NadekoBot/Common/SmartText/SmartEmbedText.cs index aa1296227..448c2fd17 100644 --- a/src/NadekoBot/Common/SmartText/SmartEmbedText.cs +++ b/src/NadekoBot/Common/SmartText/SmartEmbedText.cs @@ -20,7 +20,10 @@ public sealed record SmartEmbedArrayElementText : SmartEmbedTextBase protected override EmbedBuilder GetEmbedInternal() { var embed = base.GetEmbedInternal(); - return embed.WithColor(Rgba32.ParseHex(Color).ToDiscordColor()); + if (Rgba32.TryParseHex(Color, out var color)) + return embed.WithColor(color.ToDiscordColor()); + + return embed; } }