From c2910b98e86289f2c2566696ba207d4d04c1edd5 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 17 Feb 2022 16:50:21 -0500 Subject: [PATCH] ImportHandler: Skip default pad text when importing to a new pad --- src/node/handler/ImportHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index c77a46240..342dd5b7f 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -139,7 +139,8 @@ const doImport = async (req, res, padId) => { let directDatabaseAccess = false; if (fileIsEtherpad) { - const pad = await padManager.getPad(padId); + // Use '\n' to avoid the default pad text if the pad doesn't yet exist. + const pad = await padManager.getPad(padId, '\n'); const headCount = pad.head; if (headCount >= 10) { logger.warn('Aborting direct database import attempt of a pad that already has content');