diff options
author | John McLear <john@mclear.co.uk> | 2014-03-14 17:22:46 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2014-03-14 17:22:46 +0000 |
commit | cd0f5742f606e7310f735cb879aa0f19595ac023 (patch) | |
tree | 793076f5656734e30f00d3451901034c383f3f6b /src/node/db/SessionManager.js | |
parent | cc03f5374cb1027b60a5cd09d9223f68b12ba50c (diff) | |
parent | a00c5054038393332cdc2e257f4f4817bfdc95b5 (diff) | |
download | etherpad-lite-cd0f5742f606e7310f735cb879aa0f19595ac023.zip |
Merge pull request #2108 from goldquest/dev_deleteSessionBug
Session deletion error, when group2session/author2session are not available
Diffstat (limited to 'src/node/db/SessionManager.js')
-rw-r--r-- | src/node/db/SessionManager.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/node/db/SessionManager.js b/src/node/db/SessionManager.js index b6ff1ce9..71315adc 100644 --- a/src/node/db/SessionManager.js +++ b/src/node/db/SessionManager.js @@ -263,12 +263,16 @@ exports.deleteSession = function(sessionID, callback) db.remove("session:" + sessionID); //remove session from group2sessions - delete group2sessions.sessionIDs[sessionID]; - db.set("group2sessions:" + groupID, group2sessions); - + if(group2sessions != null) { // Maybe the group was already deleted + delete group2sessions.sessionIDs[sessionID]; + db.set("group2sessions:" + groupID, group2sessions); + } + //remove session from author2sessions - delete author2sessions.sessionIDs[sessionID]; - db.set("author2sessions:" + authorID, author2sessions); + if(author2sessions != null) { // Maybe the author was already deleted + delete author2sessions.sessionIDs[sessionID]; + db.set("author2sessions:" + authorID, author2sessions); + } callback(); } |