-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Requires.NotNull-->ArgumentNullException.ThrowIfNull #18820
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
Requires.NotNull-->ArgumentNullException.ThrowIfNull #18820
Conversation
| public static void OnCommandLineAccepted(PredictionClient client, IReadOnlyList<string> history) | ||
| { | ||
| Requires.NotNull(history, nameof(history)); | ||
| ArgumentNullException.ThrowIfNull(history, nameof(history)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to have second argument. Below too.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
xtqqczze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs
Outdated
Show resolved
Hide resolved
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
This reverts commit 0788669.
|
🎉 Handy links: |
PR Summary
Replace all
NotNullwithArgumentNullException.ThrowIfNullexcluding ComInterop codePR Context
As discussed in #18792
The new API ArgumentNullException.ThrowIfNull allows you to omit the parameter name, in which case it will use the name of the argument passed in. The passed in argument usually is the parameter to be validated, so that's just the right name to use when calling
ArgumentNullException.ThrowIfNull(argument).