mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +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);
|
db.remove("session:" + sessionID);
|
||||||
|
|
||||||
//remove session from group2sessions
|
//remove session from group2sessions
|
||||||
|
if(group2sessions != null) { // Maybe the group was already deleted
|
||||||
delete group2sessions.sessionIDs[sessionID];
|
delete group2sessions.sessionIDs[sessionID];
|
||||||
db.set("group2sessions:" + groupID, group2sessions);
|
db.set("group2sessions:" + groupID, group2sessions);
|
||||||
|
}
|
||||||
|
|
||||||
//remove session from author2sessions
|
//remove session from author2sessions
|
||||||
|
if(author2sessions != null) { // Maybe the author was already deleted
|
||||||
delete author2sessions.sessionIDs[sessionID];
|
delete author2sessions.sessionIDs[sessionID];
|
||||||
db.set("author2sessions:" + authorID, author2sessions);
|
db.set("author2sessions:" + authorID, author2sessions);
|
||||||
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue