Skip to content

Commit 457a60b

Browse files
committed
[Modify] Polish it
1 parent 78cc325 commit 457a60b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

websocket-sharp/Server/WebSocketBehavior.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,21 @@ public string Protocol {
349349
set {
350350
if (ConnectionState != WebSocketState.Connecting) {
351351
var msg = "The session has already started.";
352+
352353
throw new InvalidOperationException (msg);
353354
}
354355

355356
if (value == null || value.Length == 0) {
356357
_protocol = null;
358+
357359
return;
358360
}
359361

360-
if (!value.IsToken ())
361-
throw new ArgumentException ("Not a token.", "value");
362+
if (!value.IsToken ()) {
363+
var msg = "It is not a token.";
364+
365+
throw new ArgumentException (msg, "value");
366+
}
362367

363368
_protocol = value;
364369
}

0 commit comments

Comments
 (0)