Skip to content

Commit ef304c1

Browse files
authored
Fix formatting (#1039)
1 parent 007fc5d commit ef304c1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Transports.AspNetCore/WebSockets/GraphQLWs/SubscriptionServer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,9 @@ await Connection.SendMessageAsync(new OperationMessage
196196
/// <inheritdoc/>
197197
protected override async Task<ExecutionResult> ExecuteRequestAsync(OperationMessage message)
198198
{
199-
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload);
200199
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
201-
if (request == null)
202-
throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
200+
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload)
201+
?? throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
203202
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
204203
var scope = ServiceScopeFactory.CreateScope();
205204
try

src/Transports.AspNetCore/WebSockets/SubscriptionsTransportWs/SubscriptionServer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,9 @@ await Connection.SendMessageAsync(new OperationMessage
174174
/// <inheritdoc/>
175175
protected override async Task<ExecutionResult> ExecuteRequestAsync(OperationMessage message)
176176
{
177-
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload);
178177
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
179-
if (request == null)
180-
throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
178+
var request = Serializer.ReadNode<GraphQLRequest>(message.Payload)
179+
?? throw new ArgumentNullException(nameof(message) + "." + nameof(OperationMessage.Payload));
181180
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
182181
var scope = ServiceScopeFactory.CreateScope();
183182
try

0 commit comments

Comments
 (0)