ExpressiveAnnotations icon indicating copy to clipboard operation
ExpressiveAnnotations copied to clipboard

Concurrent validation using RequiredIfAttribute throws NullReferenceException

Open xhafan opened this issue 2 years ago • 1 comments

When concurrently validating an instance of a class which uses RequiredIfAttribute, multiple threads share the same instance of RequiredIfAttribute (likely by design), and it breaks in ExpressiveAttribute.AdjustMemberName as it's setting PropertyType to null on the RequiredIfAttribute instance which is used by other threads, which might throw NullReferenceException when the PropertyType is null.

xhafan avatar Apr 04 '23 12:04 xhafan

PR: https://github.com/jwaliszko/ExpressiveAnnotations/pull/215

xhafan avatar Apr 04 '23 14:04 xhafan