Skip to content

Commit

Permalink
Use ArgumentNullException instead null coalescing
Browse files Browse the repository at this point in the history
According to the dotnet#50665 I have made a small change. With this change, this method will not use null coalescing operators to fire the ArgumentNullException exception.

It will use ArgumentNullException.ThrowIfNull instead of it.
  • Loading branch information
Ali GOREN committed Oct 28, 2023
1 parent 008fc0c commit 1d1fbdd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Components/Authorization/src/AuthenticationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class AuthenticationState
/// <param name="user">A <see cref="ClaimsPrincipal"/> representing the user.</param>
public AuthenticationState(ClaimsPrincipal user)
{
User = user ?? throw new ArgumentNullException(nameof(user));
ArgumentNullException.ThrowIfNull(user);
User = user;
}

/// <summary>
Expand Down

0 comments on commit 1d1fbdd

Please sign in to comment.