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