From 94ff2e69edc8b3ac311be9fc02ccf17470f2db9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Hjorth=C3=B8j?= Date: Sun, 26 Sep 2021 17:16:43 +0200 Subject: [PATCH] Added restriction for description not being null (#200) --- .../Interactions/Slash Commands/SlashCommandBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs index 4abf84eb3..16855b818 100644 --- a/src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs @@ -50,7 +50,8 @@ namespace Discord } /// - /// A 1-100 length description of this slash command + /// A 1-100 length description of this slash command. + /// The description is not allowed to be null. /// public string Description { @@ -60,6 +61,7 @@ namespace Discord } set { + Preconditions.NotNullOrEmpty(value, nameof(Description)); Preconditions.AtLeast(value.Length, 1, nameof(Description)); Preconditions.AtMost(value.Length, MaxDescriptionLength, nameof(Description));