Fixed to handle startConnection and finishConnection undefined exceptions
This commit is contained in:
parent
bc31e9fe3b
commit
523048f111
1 changed files with 2 additions and 2 deletions
|
@ -260,7 +260,7 @@ function finishConnection(socket, note, user) {
|
|||
|
||||
//clear finished socket in queue
|
||||
for (var i = 0; i < connectionSocketQueue.length; i++) {
|
||||
if (connectionSocketQueue[i].id == socket.id)
|
||||
if (!connectionSocketQueue[i] || connectionSocketQueue[i].id == socket.id)
|
||||
connectionSocketQueue.splice(i, 1);
|
||||
}
|
||||
//seek for next socket
|
||||
|
@ -386,7 +386,7 @@ function disconnect(socket) {
|
|||
|
||||
//clear finished socket in queue
|
||||
for (var i = 0; i < disconnectSocketQueue.length; i++) {
|
||||
if (disconnectSocketQueue[i].id == socket.id)
|
||||
if (!disconnectSocketQueue[i] || disconnectSocketQueue[i].id == socket.id)
|
||||
disconnectSocketQueue.splice(i, 1);
|
||||
}
|
||||
//seek for next socket
|
||||
|
|
Loading…
Reference in a new issue