RCS1255: Simplify argument null check
Properties
Property | Value |
---|---|
Default Severity | disabled by default |
Minimum language version | - |
Summary
Use ArgumentNullException.ThrowIfNull
instead of if
null check.
Examples
Example #1
diagnostic.cs
if (arg is null)
{
throw new ArgumentNullException(nameof(arg));
}
fix.cs
ArgumentNullException.ThrowIfNull(arg);