bugfix: Fix #4120 where an author might not be populated on restart - if this is the case don't push the author to the array.

pull/4140/head
John McLear 2020-06-17 10:54:10 +01:00 committed by GitHub
parent d19937fa06
commit beccf677a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1496,8 +1496,12 @@ exports.padUsers = async function(padID) {
let s = sessioninfos[roomClient.id]; let s = sessioninfos[roomClient.id];
if (s) { if (s) {
return authorManager.getAuthor(s.author).then(author => { return authorManager.getAuthor(s.author).then(author => {
author.id = s.author; // Fixes: https://github.com/ether/etherpad-lite/issues/4120
padUsers.push(author); // On restart author might not be populated?
if(author){
author.id = s.author;
padUsers.push(author);
}
}); });
} }
})); }));