[Modify] Polish it

This commit is contained in:
sta 2021-10-29 19:35:08 +09:00
parent 78cc325f97
commit 457a60b6cd

View File

@ -349,16 +349,21 @@ namespace WebSocketSharp.Server
set { set {
if (ConnectionState != WebSocketState.Connecting) { if (ConnectionState != WebSocketState.Connecting) {
var msg = "The session has already started."; var msg = "The session has already started.";
throw new InvalidOperationException (msg); throw new InvalidOperationException (msg);
} }
if (value == null || value.Length == 0) { if (value == null || value.Length == 0) {
_protocol = null; _protocol = null;
return; return;
} }
if (!value.IsToken ()) if (!value.IsToken ()) {
throw new ArgumentException ("Not a token.", "value"); var msg = "It is not a token.";
throw new ArgumentException (msg, "value");
}
_protocol = value; _protocol = value;
} }