From 92b007dc4d3de41d68ec79104da433d8a3391df0 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 22 Sep 2024 19:01:19 -0400 Subject: [PATCH] Correct bad argument assertions --- .../GraphQL/Mutations/UserMutations.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Tgstation.Server.Host/GraphQL/Mutations/UserMutations.cs b/src/Tgstation.Server.Host/GraphQL/Mutations/UserMutations.cs index 943116ed79..64c671a7cb 100644 --- a/src/Tgstation.Server.Host/GraphQL/Mutations/UserMutations.cs +++ b/src/Tgstation.Server.Host/GraphQL/Mutations/UserMutations.cs @@ -46,8 +46,8 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrWhiteSpace(name); - ArgumentException.ThrowIfNullOrEmpty(password); + ArgumentNullException.ThrowIfNull(name); + ArgumentNullException.ThrowIfNull(password); ArgumentNullException.ThrowIfNull(userAuthority); return userAuthority.InvokeTransformable( @@ -98,8 +98,8 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrWhiteSpace(name); - ArgumentException.ThrowIfNullOrEmpty(password); + ArgumentNullException.ThrowIfNull(name); + ArgumentNullException.ThrowIfNull(password); ArgumentNullException.ThrowIfNull(userAuthority); return userAuthority.InvokeTransformable( @@ -145,7 +145,7 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrWhiteSpace(name); + ArgumentNullException.ThrowIfNull(name); ArgumentNullException.ThrowIfNull(oAuthConnections); ArgumentNullException.ThrowIfNull(userAuthority); @@ -195,7 +195,7 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrWhiteSpace(name); + ArgumentNullException.ThrowIfNull(name); ArgumentNullException.ThrowIfNull(oAuthConnections); ArgumentNullException.ThrowIfNull(userAuthority); @@ -242,7 +242,7 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrWhiteSpace(systemIdentifier); + ArgumentNullException.ThrowIfNull(systemIdentifier); ArgumentNullException.ThrowIfNull(userAuthority); return userAuthority.InvokeTransformable( @@ -290,7 +290,7 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrWhiteSpace(systemIdentifier); + ArgumentNullException.ThrowIfNull(systemIdentifier); ArgumentNullException.ThrowIfNull(userAuthority); return userAuthority.InvokeTransformable( @@ -331,7 +331,7 @@ namespace Tgstation.Server.Host.GraphQL.Mutations [Service] IGraphQLAuthorityInvoker userAuthority, CancellationToken cancellationToken) { - ArgumentException.ThrowIfNullOrEmpty(newPassword); + ArgumentNullException.ThrowIfNull(newPassword); ArgumentNullException.ThrowIfNull(userAuthority); return userAuthority.InvokeTransformable( async authority => await authority.Update(