Skip to content

Update to fix InvokeAsync usage #1785

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

Merged
merged 1 commit into from
Oct 30, 2018
Merged

Conversation

BertanAygun
Copy link
Contributor

InvokeAsync extension method internally handles the event handler being null, per recommendation patterns like "await StartAsync?.InvokeAsync" should be awaited since it will cause NullReferenceException in case StartAsync is null. Removing "?" and letting InvokeAsync handle it does the expected action which is a no-op

Before creating your pull request, please check your content against these quality criteria:

  • For new articles, did you add it to the TOC?
  • Did you update ms.date for new or significantly updated articles?
  • Did you consider SEO when you chose the title in the metadata, the H1 heading (displayed title), and summary (first paragraph)?
  • Is the content concise and conversational?
  • Are technical terms and concepts introduced and explained, and are acronyms spelled out on first mention?
  • Do screenshots display any personally identifiable information?
  • Do all the images you added have alt text?
  • Should this page be linked to from other pages or Microsoft web sites?

After you create the pull request and the Acrolinx and build checks have run, please:

  • Check the Acrolinx report and make sure the score is at least 80.
  • Review the staged content to see how it looks when built.

Additional resources:

InvokeAsync extension method internally handles the event handler being null, per recommendation patterns like "await StartAsync?.InvokeAsync" should be awaited since it will cause NullReferenceException in case StartAsync is null. Removing "?" and letting InvokeAsync handle it does the expected action which is a no-op
@PRMerger17
Copy link
Contributor

@BertanAygun : Thanks for your contribution! The author, @gregvanl, has been notified to review your proposed change.

@gregvanl
Copy link

#sign-off

@ktoliver ktoliver merged commit 26705d3 into MicrosoftDocs:master Oct 30, 2018
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.

5 participants