File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
FluentValidation.AutoValidation.Mvc/src/Filters Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,15 @@ public async Task OnActionExecutionAsync(ActionExecutingContext actionExecutingC
5555 if ( actionExecutingContext . ActionArguments . TryGetValue ( parameter . Name , out var subject ) )
5656 {
5757 var parameterInfo = ( parameter as ControllerParameterDescriptor ) ? . ParameterInfo ;
58- var parameterType = subject ! . GetType ( ) ;
58+ var parameterType = subject ? . GetType ( ) ;
5959 var bindingSource = parameter . BindingInfo ? . BindingSource ;
6060
6161 var hasAutoValidateAlwaysAttribute = parameterInfo ? . HasCustomAttribute < AutoValidateAlwaysAttribute > ( ) ?? false ;
6262 var hasAutoValidateNeverAttribute = parameterInfo ? . HasCustomAttribute < AutoValidateNeverAttribute > ( ) ?? false ;
6363
6464 if ( subject != null && parameterType . IsCustomType ( ) &&
6565 ! hasAutoValidateNeverAttribute && ( hasAutoValidateAlwaysAttribute || HasValidBindingSource ( bindingSource ) ) &&
66- serviceProvider . GetValidator ( parameterType ) is IValidator validator )
66+ serviceProvider . GetValidator ( parameterType ! ) is IValidator validator )
6767 {
6868 // ReSharper disable once SuspiciousTypeConversion.Global
6969 var validatorInterceptor = validator as IValidatorInterceptor ;
You can’t perform that action at this time.
0 commit comments