From c45a84e11049c5cd4c7fab6a49b63444fbf457c4 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 5 May 2023 16:54:26 +0530 Subject: [PATCH] Check if e2eeAccount is available first --- src/matrix/Session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 8fa9ef59..2f4e0f1d 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -795,7 +795,7 @@ export class Session { // to-device messages, to help us avoid throwing away one-time-keys that we // are about to receive messages for // (https://github.com/vector-im/riot-web/issues/2782). - if (!isCatchupSync) { + if (this._e2eeAccount && !isCatchupSync) { const needsToUploadOTKs = await this._e2eeAccount.generateOTKsIfNeeded(this._storage, log); if (needsToUploadOTKs) { await log.wrap("uploadKeys", log => this._e2eeAccount.uploadKeys(this._storage, false, log));