mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
Replace ifs with ArgumentNullException.ThrowIfNull
This commit is contained in:
@@ -51,10 +51,8 @@ namespace Tgstation.Server.Host.Security
|
||||
/// <inheritdoc />
|
||||
public void CacheSystemIdentity(User user, ISystemIdentity systemIdentity, DateTimeOffset expiry)
|
||||
{
|
||||
if (user == null)
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
if (systemIdentity == null)
|
||||
throw new ArgumentNullException(nameof(systemIdentity));
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
ArgumentNullException.ThrowIfNull(systemIdentity);
|
||||
|
||||
lock (cachedIdentities)
|
||||
{
|
||||
@@ -84,8 +82,7 @@ namespace Tgstation.Server.Host.Security
|
||||
/// <inheritdoc />
|
||||
public ISystemIdentity LoadCachedIdentity(User user)
|
||||
{
|
||||
if (user == null)
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
lock (cachedIdentities)
|
||||
if (cachedIdentities.TryGetValue(user.Id.Value, out var identity))
|
||||
return identity.SystemIdentity.Clone();
|
||||
|
||||
Reference in New Issue
Block a user