mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Sometimes, the author2session / group2session don't exist anymore, but the session does.
It should be possible to delete a session, if they don't exist
This commit is contained in:
parent
cc03f5374c
commit
a00c505403
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