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