[Modify] Throw exception
This commit is contained in:
parent
814b64e019
commit
189d8b38ec
@ -880,7 +880,11 @@ namespace WebSocketSharp.Server
|
||||
public void CloseSession (string id, ushort code, string reason)
|
||||
{
|
||||
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.Close (code, reason);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user