summaryrefslogtreecommitdiff
path: root/src/node/db/SessionManager.js
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2014-03-14 17:22:46 +0000
committerJohn McLear <john@mclear.co.uk>2014-03-14 17:22:46 +0000
commitcd0f5742f606e7310f735cb879aa0f19595ac023 (patch)
tree793076f5656734e30f00d3451901034c383f3f6b /src/node/db/SessionManager.js
parentcc03f5374cb1027b60a5cd09d9223f68b12ba50c (diff)
parenta00c5054038393332cdc2e257f4f4817bfdc95b5 (diff)
downloadetherpad-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.js14
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();
}