[Modify] Throw exception

master
sta 8 years ago
parent feca747684
commit 0af4c88f6a

@ -1024,7 +1024,11 @@ namespace WebSocketSharp.Server
public void SendTo (string data, string id)
{
IWebSocketSession session;
if (TryGetSession (id, out session))
if (!TryGetSession (id, out session)) {
var msg = "The session could not be found.";
throw new ArgumentException (msg, "id");
}
session.Context.WebSocket.Send (data);
}

Loading…
Cancel
Save