diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 36a9b866..efdc5904 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -384,7 +384,7 @@ export class Session { // sync transaction succeeded, modify object state now this._syncInfo = syncInfo; } - if (this._e2eeAccount && e2eeAccountChanges) { + if (this._e2eeAccount) { this._e2eeAccount.afterSync(e2eeAccountChanges); } } diff --git a/src/matrix/e2ee/Account.js b/src/matrix/e2ee/Account.js index 37fab7d2..c0cfd8de 100644 --- a/src/matrix/e2ee/Account.js +++ b/src/matrix/e2ee/Account.js @@ -171,7 +171,7 @@ export class Account { writeSync(deviceOneTimeKeysCount, txn) { // we only upload signed_curve25519 otks - const otkCount = deviceOneTimeKeysCount.signed_curve25519; + const otkCount = deviceOneTimeKeysCount.signed_curve25519 || 0; if (Number.isSafeInteger(otkCount) && otkCount !== this._serverOTKCount) { txn.session.set(SERVER_OTK_COUNT_SESSION_KEY, otkCount); return otkCount;