Skip to content

Intermittent ArgumentNullException thrown in AutoTaskProvider #600

Closed
@brianfeucht

Description

@brianfeucht

Describe the bug
I am seeing an intermittent ArgumentNullException thrown by the AutoTaskProvider in our test suite. The error moves around in our test suite, but it always has the same stacktrace:

System.ArgumentNullException : Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at NSubstitute.Routing.AutoValues.AutoTaskProvider.GetValue(Type type)
   at NSubstitute.Routing.Handlers.ReturnAutoValue.GetResultValueUsingProvider(ICall call, Type type, IAutoValueProvider provider)
   at NSubstitute.Routing.Handlers.ReturnAutoValue.Handle(ICall call)
   at NSubstitute.Routing.Route.Handle(ICall call)
   at NSubstitute.Proxies.CastleDynamicProxy.CastleForwardingInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.ObjectProxy_55.Read(Asset asset)

This behavior started after updating NSubstitute from 3.1.0 to 4.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions