Skip to content

Commit

Permalink
Merge pull request #687 from Akeit0/master
Browse files Browse the repository at this point in the history
Fix unintended multiple registrations
  • Loading branch information
hadashiA authored Jun 25, 2024
2 parents 129dc92 + 3e1846f commit 17e5789
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ internal void CollectFromParentScopes(
if (scope.TryGetRegistration(finderType, out var registration) &&
registration.Provider is CollectionInstanceProvider parentCollection)
{
mergedRegistrations = mergedRegistrations ?? ListPool<Registration>.Get();
mergedRegistrations.AddRange(registrations);
if (mergedRegistrations == null)
{
mergedRegistrations = ListPool<Registration>.Get();
mergedRegistrations.AddRange(registrations);
}

if (localScopeOnly)
{
Expand Down

0 comments on commit 17e5789

Please sign in to comment.