mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00
(GH-226) Switch ParameterValidationAttribute check to IsNullOrWhiteSpace
* fixes #226
This commit is contained in:
parent
35568ab823
commit
a3e11b24e5
@ -33,9 +33,9 @@ namespace Spectre.Console.Cli.Internal
|
||||
{
|
||||
// If there is a error message specified in the parameter validator attribute,
|
||||
// then use that one, otherwise use the validation result.
|
||||
var result = validator.ErrorMessage != null
|
||||
? ValidationResult.Error(validator.ErrorMessage)
|
||||
: validationResult;
|
||||
var result = string.IsNullOrWhiteSpace(validator.ErrorMessage)
|
||||
? validationResult
|
||||
: ValidationResult.Error(validator.ErrorMessage);
|
||||
|
||||
throw CommandRuntimeException.ValidationFailed(result);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user