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
55
55
if ( actionExecutingContext . ActionArguments . TryGetValue ( parameter . Name , out var subject ) )
56
56
{
57
57
var parameterInfo = ( parameter as ControllerParameterDescriptor ) ? . ParameterInfo ;
58
- var parameterType = subject ! . GetType ( ) ;
58
+ var parameterType = subject ? . GetType ( ) ;
59
59
var bindingSource = parameter . BindingInfo ? . BindingSource ;
60
60
61
61
var hasAutoValidateAlwaysAttribute = parameterInfo ? . HasCustomAttribute < AutoValidateAlwaysAttribute > ( ) ?? false ;
62
62
var hasAutoValidateNeverAttribute = parameterInfo ? . HasCustomAttribute < AutoValidateNeverAttribute > ( ) ?? false ;
63
63
64
64
if ( subject != null && parameterType . IsCustomType ( ) &&
65
65
! hasAutoValidateNeverAttribute && ( hasAutoValidateAlwaysAttribute || HasValidBindingSource ( bindingSource ) ) &&
66
- serviceProvider . GetValidator ( parameterType ) is IValidator validator )
66
+ serviceProvider . GetValidator ( parameterType ! ) is IValidator validator )
67
67
{
68
68
// ReSharper disable once SuspiciousTypeConversion.Global
69
69
var validatorInterceptor = validator as IValidatorInterceptor ;
You can’t perform that action at this time.
0 commit comments