[Modify] Throw exception

This commit is contained in:
sta 2017-08-12 16:02:09 +09:00
parent dd17dacf53
commit 5e0ea01ec0

View File

@ -979,7 +979,11 @@ namespace WebSocketSharp.Server
public void SendTo (byte[] 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);
}