Browse Source

NullOrEmpty -> NullOrWhiteSpace

Seeing as D.NET will warn you about an impending BadRequest if you try and send an empty field, why not make it warn about the impending BadRequest if you try and send a whitespace field?
pull/758/head
Jay Malhotra GitHub 8 years ago
parent
commit
0429e75795
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs

+ 1
- 1
src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs View File

@@ -249,7 +249,7 @@ namespace Discord
get => _field.Name;
set
{
if (string.IsNullOrEmpty(value)) throw new ArgumentException($"Field name must not be null or empty.", nameof(Name));
if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException($"Field name must not be null, empty or entirely whitespace.", nameof(Name));
if (value.Length > MaxFieldNameLength) throw new ArgumentException($"Field name length must be less than or equal to {MaxFieldNameLength}.", nameof(Name));
_field.Name = value;
}


Loading…
Cancel
Save