diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 752710217..1399c5d2b 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -167,7 +167,8 @@ exports.handleMessage = function(client, message) { return; } - if(!sessioninfos[client.id]) { + var thisSession = sessioninfos[client.id] + if(!thisSession) { messageLogger.warn("Dropped message from an unknown connection.") return; } @@ -196,7 +197,7 @@ exports.handleMessage = function(client, message) } else if(message.type == "CHANGESET_REQ") { handleChangesetRequest(client, message); } else if(message.type == "COLLABROOM") { - if (sessioninfos[client.id].readonly) { + if (thisSession.readonly) { messageLogger.warn("Dropped message, COLLABROOM for readonly pad"); } else if (message.data.type == "USER_CHANGES") { stats.counter('pendingEdits').inc()