Skip to content

Enable nullability in ToolStripComboBoxControl#8050

Merged
dreddy-work merged 1 commit intodotnet:mainfrom
gpetrou:ToolStripComboBoxControl
Oct 28, 2022
Merged

Enable nullability in ToolStripComboBoxControl#8050
dreddy-work merged 1 commit intodotnet:mainfrom
gpetrou:ToolStripComboBoxControl

Conversation

@gpetrou
Copy link
Contributor

@gpetrou gpetrou commented Oct 27, 2022

Proposed changes

  • Enable nullability in ToolStripComboBoxControl.
Microsoft Reviewers: Open in CodeFlow

@gpetrou gpetrou requested a review from a team as a code owner October 27, 2022 16:02
@ghost ghost assigned gpetrou Oct 27, 2022
@ghost ghost added the area: NRT label Oct 27, 2022
@RussKie RussKie enabled auto-merge (squash) October 27, 2022 23:02
{
ToolStripComboBoxControl? toolStripComboBox = comboBox as ToolStripComboBoxControl;
if (toolStripComboBox is null || !(toolStripComboBox.Owner.Renderer is ToolStripProfessionalRenderer))
if (toolStripComboBox is null || toolStripComboBox.Owner?.Renderer is not ToolStripProfessionalRenderer)
Copy link
Member

Choose a reason for hiding this comment

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

is this avoiding null reference exception? or we were just missing the check earlier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because Owner can be null, there is a warning now, so I added the ? operator.

@dreddy-work dreddy-work disabled auto-merge October 27, 2022 23:04
@dreddy-work dreddy-work merged commit 7ef9532 into dotnet:main Oct 28, 2022
@ghost ghost added this to the 8.0 Preview1 milestone Oct 28, 2022
@gpetrou gpetrou deleted the ToolStripComboBoxControl branch October 29, 2022 04:38
@ghost ghost locked as resolved and limited conversation to collaborators Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants