1

Closed

Prevent throwing NullReferenceException when applying property injection to Func<T> that returns null.

description

When users register a Func<T> delegate for the creation of a type, the container wraps this delegate in another delegate that performs a null check. This ensures that a descriptive exception is thrown in case the Func<T> returns null.

This null check however is currently added after applying property injection. If any properties are applied to a Func<T> registration, it would still result in a NullReferenceException in the case that the Func<T> returned null.
Closed Mar 26, 2013 at 11:48 AM by dot_NET_Junkie

comments

wrote Mar 26, 2013 at 11:48 AM

Resolved with changeset 99520: Bugfix: NullReferenceException could be thrown by the container in case a Func was registered that returned null, while properties where applied (using a custom IPropertySelectionBehavior) to that given T.