mirror of https://github.com/status-im/codimd.git
Fixed to handle startConnection and finishConnection undefined exceptions
This commit is contained in:
parent
bc31e9fe3b
commit
523048f111
|
@ -260,7 +260,7 @@ function finishConnection(socket, note, user) {
|
||||||
|
|
||||||
//clear finished socket in queue
|
//clear finished socket in queue
|
||||||
for (var i = 0; i < connectionSocketQueue.length; i++) {
|
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);
|
connectionSocketQueue.splice(i, 1);
|
||||||
}
|
}
|
||||||
//seek for next socket
|
//seek for next socket
|
||||||
|
@ -386,7 +386,7 @@ function disconnect(socket) {
|
||||||
|
|
||||||
//clear finished socket in queue
|
//clear finished socket in queue
|
||||||
for (var i = 0; i < disconnectSocketQueue.length; i++) {
|
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);
|
disconnectSocketQueue.splice(i, 1);
|
||||||
}
|
}
|
||||||
//seek for next socket
|
//seek for next socket
|
||||||
|
|
Loading…
Reference in New Issue