Skip to content

Commit

Permalink
Merge pull request #6498 from sesamefly/patch-1
Browse files Browse the repository at this point in the history
Check `context.Metadata.ContainerType` if is null.
  • Loading branch information
maliming authored Dec 7, 2020
2 parents 492ad08 + 61be1bd commit 90a7039
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public IModelBinder GetBinder(ModelBinderProviderContext context)
return null;
}

if (!context.Metadata.ContainerType.IsAssignableTo<IHasExtraProperties>())
if (context.Metadata.ContainerType == null ||
!context.Metadata.ContainerType.IsAssignableTo<IHasExtraProperties>())
{
return null;
}
Expand Down

0 comments on commit 90a7039

Please sign in to comment.