Simplify a null check

This commit is contained in:
Jordan Dominion
2023-12-23 10:35:06 -05:00
parent ffbf0f5ba7
commit c4da6df175
@@ -546,10 +546,8 @@ namespace Tgstation.Server.Host.Components
{
ArgumentNullException.ThrowIfNull(bridgeHandler);
var accessIdentifier = bridgeHandler.DMApiParameters.AccessIdentifier;
if (accessIdentifier == null)
throw new InvalidOperationException("Attempted bridge registration with null AccessIdentifier!");
var accessIdentifier = bridgeHandler.DMApiParameters.AccessIdentifier
?? throw new InvalidOperationException("Attempted bridge registration with null AccessIdentifier!");
lock (bridgeHandlers)
{
bridgeHandlers.Add(accessIdentifier, bridgeHandler);