make PadMessageHandler more robust against timing issues

pull/341/head
Azul 2012-01-19 13:02:46 +01:00
parent 9f0ca7cc44
commit c4f9268cfa
1 changed files with 10 additions and 2 deletions

View File

@ -516,7 +516,12 @@ exports.updatePadClients = function(pad, callback)
], function(err)
{
if(ERR(err, callback)) return;
// next if session has not been deleted
if(sessioninfos[session] == null)
{
callback(null);
return;
}
if(author == sessioninfos[session].author)
{
socketio.sockets.sockets[session].json.send({"type":"COLLABROOM","data":{type:"ACCEPT_COMMIT", newRev:r}});
@ -538,7 +543,10 @@ exports.updatePadClients = function(pad, callback)
callback
);
sessioninfos[session].rev = pad.getHeadRevisionNumber();
if(sessioninfos[session] != null)
{
sessioninfos[session].rev = pad.getHeadRevisionNumber();
}
},callback);
}