diff --git a/websocket-sharp/Server/WebSocketSessionManager.cs b/websocket-sharp/Server/WebSocketSessionManager.cs index 3a752937..380dbfa2 100644 --- a/websocket-sharp/Server/WebSocketSessionManager.cs +++ b/websocket-sharp/Server/WebSocketSessionManager.cs @@ -887,8 +887,10 @@ namespace WebSocketSharp.Server public void CloseSession (string id) { IWebSocketSession session; + if (!TryGetSession (id, out session)) { var msg = "The session could not be found."; + throw new InvalidOperationException (msg); }