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

Handle null Type in ServiceCacheKey.GetHashCode #52115

Merged
merged 1 commit into from
May 1, 2021
Merged

Handle null Type in ServiceCacheKey.GetHashCode #52115

merged 1 commit into from
May 1, 2021

Conversation

Tornhoof
Copy link
Contributor

@Tornhoof Tornhoof commented Apr 30, 2021

Found in #52035 (comment)
For static ServiceCacheKey.Empty the Type is null, this would throw a NullReferenceException.
As the library has net461 as a build target, HashCode.Combine can't be used. I added parenthesis for better readability.
No extra tests were added.

@ghost
Copy link

ghost commented Apr 30, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

For static ServiceCacheKey.Empty the Type is null, this would throw a NullReferenceException.
As the library has net461 as a build target, HashCode.Combine can't be used. I added parenthesis for better readability.
No extra tests were added.

Author: Tornhoof
Assignees: -
Labels:

area-Extensions-DependencyInjection

Milestone: -

@davidfowl davidfowl merged commit 91e9005 into dotnet:main May 1, 2021
@Tornhoof Tornhoof deleted the FixNullRef branch May 1, 2021 05:07
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants