[Modify] Add a check

This commit is contained in:
sta 2016-03-26 16:25:48 +09:00
parent 5bf96cf7ff
commit 49b09654f6

View File

@ -2810,9 +2810,16 @@ namespace WebSocketSharp
/// </param>
public void SetCredentials (string username, string password, bool preAuth)
{
string msg;
if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
_logger.Error (msg);
error ("An error has occurred in setting the credentials.", null);
return;
}
lock (_forConn) {
string msg;
if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
if (!checkIfAvailable (true, false, false, true, out msg)) {
_logger.Error (msg);
error ("An error has occurred in setting the credentials.", null);