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

Type.GetType with assembly resolver and null type resolver can throw nullreferenceexception #21616

Open
khaledmousa opened this issue Feb 5, 2023 · 0 comments · May be fixed by #21617
Open

Comments

@khaledmousa
Copy link

Steps to Reproduce

  1. Create a new Xamarin.Forms project targeting Android (used Xamarin.Forms 5.0.0.2196)
  2. Execute the following statement: var t = Type.GetType(typeof(string).Name, (a) => null, null, false); at the beginning of the MainActivity.OnCreate method
  3. Run the project

Current Behavior

Statement throws a NullReferenceException

Expected Behavior

No exception is thrown, and the call to Type.GetType returns null (this behavior is confirmed on .Net 4.7.2)

Stacktrace

Exception looks to be caused by a missing null check on asm in TypeSpec.cs

Contrast this with the dotnet/runtime version

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 a pull request may close this issue.

1 participant