Check if e2eeAccount is available first

This commit is contained in:
RMidhunSuresh 2023-05-05 16:54:26 +05:30
parent c6fa81b724
commit c45a84e110

View File

@ -795,7 +795,7 @@ export class Session {
// to-device messages, to help us avoid throwing away one-time-keys that we // to-device messages, to help us avoid throwing away one-time-keys that we
// are about to receive messages for // are about to receive messages for
// (https://github.com/vector-im/riot-web/issues/2782). // (https://github.com/vector-im/riot-web/issues/2782).
if (!isCatchupSync) { if (this._e2eeAccount && !isCatchupSync) {
const needsToUploadOTKs = await this._e2eeAccount.generateOTKsIfNeeded(this._storage, log); const needsToUploadOTKs = await this._e2eeAccount.generateOTKsIfNeeded(this._storage, log);
if (needsToUploadOTKs) { if (needsToUploadOTKs) {
await log.wrap("uploadKeys", log => this._e2eeAccount.uploadKeys(this._storage, false, log)); await log.wrap("uploadKeys", log => this._e2eeAccount.uploadKeys(this._storage, false, log));