C# Error with null-conditional operator and await
You can add ?? Operator so if ?. returns null task use CompletedTask instead.
await (this.MyObject?.MyMethod() ?? Task.CompletedTask)
You can add ?? Operator so if ?. returns null task use CompletedTask instead.
await (this.MyObject?.MyMethod() ?? Task.CompletedTask)