[Modify] Use it

This commit is contained in:
sta 2016-08-12 16:59:39 +09:00
parent 8478bfd9ba
commit 03aad074e6

View File

@ -2843,20 +2843,11 @@ namespace WebSocketSharp
return;
}
if (!username.IsNullOrEmpty ()) {
if (username.Contains (':') || !username.IsText ()) {
_logger.Error ("'username' contains an invalid character.");
error ("An error has occurred in setting the credentials.", null);
if (!checkParametersForSetCredentials (username, password, out msg)) {
_logger.Error (msg);
error ("An error has occurred in setting the credentials.", null);
return;
}
if (!password.IsNullOrEmpty () && !password.IsText ()) {
_logger.Error ("'password' contains an invalid character.");
error ("An error has occurred in setting the credentials.", null);
return;
}
return;
}
lock (_forState) {