diff options
author | webzwo0i <webzwo0i@c3d2.de> | 2014-02-20 16:33:42 +0100 |
---|---|---|
committer | webzwo0i <webzwo0i@c3d2.de> | 2014-02-20 16:33:42 +0100 |
commit | c8c2866087bcac8ce93a571afbd8c2fa5d22a8de (patch) | |
tree | 1b0fca963e1c1bfbfa67aee259d8bd2aa5bf9733 /src/node/handler | |
parent | ca8dce18408ed0e9249b9fe41f6b580b91109e8a (diff) | |
download | etherpad-lite-c8c2866087bcac8ce93a571afbd8c2fa5d22a8de.zip |
fix crash if disconnect happens for sessions that have messages queued
Diffstat (limited to 'src/node/handler')
-rw-r--r-- | src/node/handler/PadMessageHandler.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 774ebf08..75271021 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -588,6 +588,14 @@ function handleUserChanges(data, cb) messageLogger.warn("Dropped message, USER_CHANGES Message has no changeset!"); return cb(); } + //TODO: this might happen with other messages too => find one place to copy the session + //and always use the copy. atm a message will be ignored if the session is gone even + //if the session was valid when the message arrived in the first place + if(!sessioninfos[client.id]) + { + messageLogger.warn("Dropped message, disconnect happened in the mean time"); + return cb(); + } //get all Vars we need var baseRev = message.data.baseRev; |