Skip to content

fix nullability of AssemblyEnumerator.GetTypes #5401

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

SimonCropp
Copy link
Contributor

Comment on lines +391 to +394
if (type == null)
{
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change in behavior.

Previously if type was null, we will go through the try, which will fail, then we get into the catch that will fail due to t.FullName (it will throw NullReferenceException).

The original intent is to probably ignore types that failed to load, but that as well wasn't a good design decision.

I think it's best in v4 if we just not catch any ReflectionTypeLoadException and let everything fail.

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.

2 participants