mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Merge pull request #2108 from goldquest/dev_deleteSessionBug
Session deletion error, when group2session/author2session are not available
This commit is contained in:
commit
cd0f5742f6
1 changed files with 9 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue