We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f4919c commit 3eed0e7Copy full SHA for 3eed0e7
1 file changed
Common/Websocket/WebsockBaseController.cs
@@ -158,7 +158,7 @@ await HttpContext.Response.WriteAsJsonAsync(
158
159
// Only send close if the socket is still open, this allows us to close the websocket from inside the logic
160
// We send close if the client sent a close message though
161
- if (WebSocket.State is WebSocketState.Open or WebSocketState.CloseReceived)
+ if (WebSocket is { State: WebSocketState.Open or WebSocketState.CloseReceived })
162
{
163
await WebSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Normal closure",
164
LinkedToken);
@@ -214,7 +214,6 @@ private async Task Logic()
214
if (WebSocket == null)
215
216
Logger.LogWarning("WebSocket is null, aborting");
217
- WebSocket?.Abort();
218
return;
219
}
220
0 commit comments