Correct empty value exception (#3064)

This commit is contained in:
Łukasz Domeradzki
2025-02-09 20:13:17 +01:00
committed by GitHub
parent c625f5fe0b
commit 6e7b3c2577

View File

@@ -545,7 +545,7 @@ namespace Discord
{
var stringValue = value?.ToString();
if (string.IsNullOrWhiteSpace(stringValue))
throw new ArgumentException(message: "Field value must not be null or empty.", paramName: nameof(Value));
throw new ArgumentException(message: "Field value must not be null, empty or entirely whitespace.", paramName: nameof(Value));
if (stringValue.Length > MaxFieldValueLength)
throw new ArgumentException(message: $"Field value length must be less than or equal to {MaxFieldValueLength}.", paramName: nameof(Value));
_value = stringValue;