From c2f9970ef0395f9fea82e1baba2e1e2614e94b5c Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Fri, 25 Sep 2015 17:37:09 +0800 Subject: [PATCH] Fixed a possible exception --- lib/realtime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;