From f0d9d13f4e64abbe44607e2d177815d8332ff1dc Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 22 Feb 2021 11:20:51 +0100 Subject: [PATCH] don't assume device lists are set in sync response --- src/matrix/Session.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); }