[Modify] Throw exception
This commit is contained in:
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…
Reference in New Issue
Block a user