Merge pull request #1085 from vector-im/fix-1081

Fix broken sdk when used without encryption
This commit is contained in:
R Midhun Suresh 2023-05-05 16:59:00 +05:30 committed by GitHub
commit 4cb11a130e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));