diff --git a/src/Fleck/WebSocketConnection.cs b/src/Fleck/WebSocketConnection.cs index 5aba274..318de65 100644 --- a/src/Fleck/WebSocketConnection.cs +++ b/src/Fleck/WebSocketConnection.cs @@ -223,8 +223,8 @@ private void CloseSocket() _closing = true; OnClose(); _closed = true; - Socket.Close(); - Socket.Dispose(); + Socket?.Close(); + Socket?.Dispose(); _closing = false; }