Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 committed Aug 19, 2024
1 parent e987564 commit 7453881
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,9 @@ await Connection.SendMessageAsync(new OperationMessage {
/// <inheritdoc/>
protected override async Task<ExecutionResult> ExecuteRequestAsync(OperationMessage message)
{
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload);
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
if (request == null)
throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload)
?? throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
using var scope = ServiceScopeFactory.CreateScope();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@ await Connection.SendMessageAsync(new OperationMessage {
/// <inheritdoc/>
protected override async Task<ExecutionResult> ExecuteRequestAsync(OperationMessage message)
{
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload);
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
if (request == null)
throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload)
?? throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
using var scope = ServiceScopeFactory.CreateScope();
try {
Expand Down
6 changes: 2 additions & 4 deletions src/Tests/Middleware/WebSocketTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ public class WebSocketTests : IDisposable

private void Configure(Action<GraphQLHttpMiddlewareOptions>? configureOptions = null, Action<IServiceCollection>? configureServices = null)
{
if (configureOptions == null)
configureOptions = _ => { };
if (configureServices == null)
configureServices = _ => { };
configureOptions ??= _ => { };
configureServices ??= _ => { };

var hostBuilder = new WebHostBuilder();
hostBuilder.ConfigureServices(services => {
Expand Down

0 comments on commit 7453881

Please sign in to comment.