diff --git a/src/matrix/Session.js b/src/matrix/Session.js index daa9ecb1..b239000d 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -393,8 +393,8 @@ export class Session { changes.e2eeAccountChanges = this._e2eeAccount.writeSync(deviceOneTimeKeysCount, txn, log); } - const deviceLists = syncResponse.device_lists; - if (this._deviceTracker && Array.isArray(deviceLists.changed) && deviceLists.changed.length) { + const deviceLists = syncResponse?.device_lists; + if (this._deviceTracker && Array.isArray(deviceLists?.changed) && deviceLists.changed.length) { await log.wrap("deviceLists", log => this._deviceTracker.writeDeviceChanges(deviceLists.changed, txn, log)); }