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

LINQ: Fixes NullReferenceException when attempting to generate SQL for a LINQ expression which performs static field or property access #3190

Merged
merged 1 commit into from
May 12, 2022

Conversation

notheotherben
Copy link
Member

@notheotherben notheotherben commented May 12, 2022

Description

This PR should fix the issue raised in #3188 in which attempts to access a static field or property (such as DateTime.UtcNow) within a LINQ-to-SQL expression will result in a NullReferenceException. It does so by correctly handling the presence of a null member expression when evaluating field and property access.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Closing issues

To automatically close an issue: closes #3188

… LINQ expression which performs static field or property access (fixes Azure#3188)
@j82w
Copy link
Contributor

j82w commented May 12, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@j82w j82w changed the title fix: Ensure that we don't crash when attempting to generate SQL for a LINQ expression which performs static field or property access LINQ: Fixes NullReferenceException when attempting to generate SQL for a LINQ expression which performs static field or property access May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants