[Modify] Throw exception

This commit is contained in:
sta 2018-05-15 19:37:21 +09:00
parent 0d920d15ee
commit 5d2d5e3568

View File

@ -483,8 +483,12 @@ namespace WebSocketSharp.Server
/// </param> /// </param>
protected void Send (FileInfo file) protected void Send (FileInfo file)
{ {
if (_websocket != null) if (_websocket == null) {
_websocket.Send (file); var msg = "The current state of the connection is not Open.";
throw new InvalidOperationException (msg);
}
_websocket.Send (file);
} }
/// <summary> /// <summary>