Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "collection modified" exception #9620

Merged

Conversation

drewnoakes
Copy link
Member

@drewnoakes drewnoakes commented Dec 12, 2024

When signalling project close to an info bar entry, if there are no other remaining projects associated with that info bar, it will be removed from the collection. That triggers an exception.

The fix is to make a defensive copy before enumerating, so that the original can be safely modified while the copy is enumerated.

Microsoft Reviewers: Open in CodeFlow

When signalling project close to an info bar entry, if there are no other remaining projects associated with that info bar, it will be removed from the collection. That triggers an exception.

The fix is to make a defensive copy before enumerating, so that the original can be safely modified while the copy is enumerated.
@drewnoakes drewnoakes requested a review from a team as a code owner December 12, 2024 11:37
@drewnoakes drewnoakes merged commit d3666d9 into dotnet:main Dec 12, 2024
5 checks passed
@drewnoakes drewnoakes deleted the fix-collection-modified-exception branch December 12, 2024 21:40
@dotnet-policy-service dotnet-policy-service bot added this to the 17.12 milestone Dec 12, 2024
@drewnoakes drewnoakes modified the milestones: 17.12, 17.13 Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants