[Modify] Throw exception

This commit is contained in:
sta 2017-08-13 15:11:29 +09:00
parent feca747684
commit 0af4c88f6a

View File

@ -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);
}