diff --git a/lib/realtime.js b/lib/realtime.js index 86d361ef1..795629012 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -298,7 +298,7 @@ function startConnection(socket) { socket.disconnect(true); //clear err 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); } isConnectionBusy = false;