mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	(GH-226) Switch ParameterValidationAttribute check to IsNullOrWhiteSpace
* fixes #226
This commit is contained in:
		 Mattias Karlsson
					Mattias Karlsson
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						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); | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user