From 9cd67cd99079b2fe1f3a9d9a1a625a2f2eabee07 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 27 Feb 2021 00:22:46 -0500 Subject: [PATCH] PadMessageHandler: Delete unnecessary use of `Promise.then()` --- src/node/handler/PadMessageHandler.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index e32fcf1d0..62d619456 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -1438,14 +1438,13 @@ exports.padUsers = async (padID) => { await Promise.all(_getRoomSockets(padID).map(async (roomSocket) => { const s = sessioninfos[roomSocket.id]; if (s) { - return authorManager.getAuthor(s.author).then((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); - } - }); + const author = await authorManager.getAuthor(s.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); + } } }));