From beccf677a45c676115fcc09f9089f738364cfdfe Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 17 Jun 2020 10:54:10 +0100 Subject: [PATCH] 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. --- src/node/handler/PadMessageHandler.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index eb3a784a2..8621a750c 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -1496,8 +1496,12 @@ exports.padUsers = async function(padID) { let s = sessioninfos[roomClient.id]; if (s) { return authorManager.getAuthor(s.author).then(author => { - author.id = s.author; - padUsers.push(author); + // Fixes: https://github.com/ether/etherpad-lite/issues/4120 + // On restart author might not be populated? + if(author){ + author.id = s.author; + padUsers.push(author); + } }); } }));