diff options
author | Wu Cheng-Han | 2015-09-25 16:57:18 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2015-09-25 16:57:18 +0800 |
commit | 523048f111250b92ab64b694941fdec487ef306e (patch) | |
tree | c563a94bc3d64724b6d263485345faf4b2fff938 /lib | |
parent | bc31e9fe3b5a720c369826fe959f9830b98c2ccc (diff) |
Fixed to handle startConnection and finishConnection undefined exceptions
Diffstat (limited to '')
-rw-r--r-- | lib/realtime.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/realtime.js b/lib/realtime.js index af33cadf..86d361ef 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -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 |