From efdf9dbe36831f5c536519f5dff56e54e043d1a1 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+SamTV12345@users.noreply.github.com> Date: Tue, 29 Aug 2023 18:00:14 +0200 Subject: [PATCH] Fixed session key rotation problem with a default empty array on null value. (#5896) --- src/node/security/SecretRotator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/security/SecretRotator.js b/src/node/security/SecretRotator.js index b02a195cd..3cc08a01c 100644 --- a/src/node/security/SecretRotator.js +++ b/src/node/security/SecretRotator.js @@ -160,7 +160,7 @@ class SecretRotator { // TODO: This is racy. If two instances start up at the same time and there are no existing // matching publications, each will generate and publish their own paramters. In practice this // is unlikely to happen, and if it does it can be fixed by restarting both Etherpad instances. - const dbKeys = await db.findKeys(`${this._dbPrefix}:*`, null); + const dbKeys = await db.findKeys(`${this._dbPrefix}:*`, null) || []; let currentParams = null; let currentId = null; const dbWrites = [];