- Developer Edition 10.1.0 on-prem
Hello,
the following code is being flagged as csharpsquid:S3900.
public static bool IsMatch(string requestPath)
{
requestPath ??= String.Empty;
requestPath = String.Concat(ForwardSlash, requestPath.Trim(ForwardSlash));
// more code
}
The call “requestPath.Trim” is marked as possible null and needs a validation check before using, but the null coalescing operator ??= does exactly the NULL check and assign a value with String.Empty, if the parameter is null.
Kind regards