From 89efe0f3add3eee046ab3c8051652d8998746389 Mon Sep 17 00:00:00 2001 From: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:08:15 +0300 Subject: [PATCH] no whitespace for ya (#2831) --- .../Interactions/MessageComponents/ComponentBuilder.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs index 5c4738ac..1637bb17 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs @@ -753,10 +753,10 @@ namespace Discord /// A non-link button must contain a custom id public ButtonComponent Build() { - if (string.IsNullOrEmpty(Label) && Emote == null) + if (string.IsNullOrWhiteSpace(Label) && Emote == null) throw new InvalidOperationException("A button must have an Emote or a label!"); - if (!(string.IsNullOrEmpty(Url) ^ string.IsNullOrEmpty(CustomId))) + if (!(string.IsNullOrWhiteSpace(Url) ^ string.IsNullOrWhiteSpace(CustomId))) throw new InvalidOperationException("A button must contain either a URL or a CustomId, but not both!"); if (Style == 0) @@ -764,11 +764,11 @@ namespace Discord if (Style == ButtonStyle.Link) { - if (string.IsNullOrEmpty(Url)) + if (string.IsNullOrWhiteSpace(Url)) throw new InvalidOperationException("Link buttons must have a link associated with them"); UrlValidation.ValidateButton(Url); } - else if (string.IsNullOrEmpty(CustomId)) + else if (string.IsNullOrWhiteSpace(CustomId)) throw new InvalidOperationException("Non-link buttons must have a custom id associated with them"); return new ButtonComponent(Style, Label, Emote, CustomId, Url, IsDisabled);