From dbfe5cadf4ca1f987942fbc888e9607c79ce3a59 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Fri, 18 Jun 2021 15:16:27 +0200 Subject: [PATCH] AuthorManager: prevent generation of an author in case no token was specified --- src/node/db/AuthorManager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node/db/AuthorManager.js b/src/node/db/AuthorManager.js index 63e151407..7c813ddf0 100644 --- a/src/node/db/AuthorManager.js +++ b/src/node/db/AuthorManager.js @@ -107,6 +107,10 @@ exports.doesAuthorExists = exports.doesAuthorExist; * @param {String} token The token */ exports.getAuthor4Token = async (token) => { + // e.g. in case of an export of a public pad, a token is not needed + if (token == null) { + return; + } const author = await mapAuthorWithDBKey('token2author', token); // return only the sub value authorID