Fix a few
This commit is contained in:
parent
253f8f7ddc
commit
d98b041c1e
@ -261,7 +261,8 @@ namespace WebSocketSharp
|
||||
internal static string CheckIfValidProtocols (this string [] protocols)
|
||||
{
|
||||
return protocols.Contains (
|
||||
protocol => protocol.Length == 0 || !protocol.IsToken ())
|
||||
protocol =>
|
||||
protocol == null || protocol.Length == 0 || !protocol.IsToken ())
|
||||
? "Contains an invalid value."
|
||||
: protocols.ContainsTwice ()
|
||||
? "Contains a value twice."
|
||||
|
@ -157,7 +157,10 @@ namespace WebSocketSharp.Server
|
||||
}
|
||||
|
||||
set {
|
||||
if (State == WebSocketState.CONNECTING && value.IsToken ())
|
||||
if (State == WebSocketState.CONNECTING &&
|
||||
value != null &&
|
||||
value.Length > 0 &&
|
||||
value.IsToken ())
|
||||
_protocol = value;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user