Skip to content

Use null propagation#9564

Merged
glen-84 merged 2 commits intomainfrom
gai/use-null-propagation
Apr 17, 2026
Merged

Use null propagation#9564
glen-84 merged 2 commits intomainfrom
gai/use-null-propagation

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Apr 17, 2026

Summary of the changes (Less than 80 chars)

  • Use null propagation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the C# codebase to prefer null-propagation (?.) and turns on the corresponding analyzer rule to encourage consistent usage.

Changes:

  • Replaced explicit null-check blocks with null-propagation in a Postgres notification listener cleanup path.
  • Simplified pooled context disposal logic with null-propagation.
  • Enabled IDE0031 (“Use null propagation”) as a warning in .editorconfig (and adjusted related analyzer settings/comments).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Mocha/src/Mocha.Transport.Postgres/Connection/PostgresNotificationListener.cs Uses null-propagation for event unsubscription in finally.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanContext.Pooling.cs Uses null-propagation when returning a context to the pool during disposal.
.editorconfig Enables IDE0031 and documents overlap with Roslynator’s conditional-access rule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .editorconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants