Skip to content

ValidationAttribute.SetResourceAccessorByPropertyLookup should throw better exception #44292

@krwq

Description

@krwq

Converting TODO-NULLABLE into the issue here since I'm not familiar with the area I'll leave it for area owner to decide if they want to close it or leave it. I'll remove the original comment in case it's decided this should be closed.

In ValidationAttribute.SetResourceAccessorByPropertyLookup (last line):

_errorMessageResourceAccessor = () => (string)property.GetValue(null, null)!;

Is commented as If the user-provided resource returns null, an ArgumentNullException is thrown - should probably throw a better exception

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions