Skip to content

Enable nullability in SendKeys#6428

Merged
dreddy-work merged 1 commit intodotnet:mainfrom
gpetrou:SendKeys
Jan 4, 2022
Merged

Enable nullability in SendKeys#6428
dreddy-work merged 1 commit intodotnet:mainfrom
gpetrou:SendKeys

Conversation

@gpetrou
Copy link
Contributor

@gpetrou gpetrou commented Dec 26, 2021

Proposed changes

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

@gpetrou gpetrou requested a review from a team as a code owner December 26, 2021 19:07
@ghost ghost assigned gpetrou Dec 26, 2021
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Thank you!

@dreddy-work dreddy-work merged commit 0f22dbc into dotnet:main Jan 4, 2022
@ghost ghost added this to the 7.0 Preview1 milestone Jan 4, 2022
@gpetrou gpetrou deleted the SendKeys branch January 4, 2022 19:19
try
{
eventsTotal = s_events.Count;
eventsTotal = s_events!.Count;
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this rather unsettling. The code is rather convoluted and I couldn't confirm that we would have called AddEvent() before getting here. So instead of using a ! it probably would be more correct to check s_events for null and exit, if it is so.

Copy link
Contributor Author

@gpetrou gpetrou Jan 6, 2022

Choose a reason for hiding this comment

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

Since this was already merged, I created #6470.

Danil-Andrianov pushed a commit to Danil-Andrianov/winforms that referenced this pull request Jan 10, 2022
/// Vector of events that we have yet to post to the journaling hook.
/// </summary>
private static Queue<SKEvent> s_events;
private static Queue<SKEvent>? s_events;
Copy link
Member

Choose a reason for hiding this comment

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

Ia right fix seems to be making this as a readonly assignment and make it non nullable.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 11, 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.

4 participants