NullOrEmpty -> NullOrWhiteSpace (#758)
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?
This commit is contained in:
committed by
RogueException
parent
22b969cbc7
commit
57a461c9ff
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user