mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
don't crash when tracked user is not there
This commit is contained in:
parent
fef6586e5b
commit
d43cdfd889
@ -47,9 +47,13 @@ export class DeviceTracker {
|
||||
const {userIdentities} = txn;
|
||||
if (Array.isArray(deviceLists.changed) && deviceLists.changed.length) {
|
||||
await Promise.all(deviceLists.changed.map(async userId => {
|
||||
const user = await userIdentities.get(userId)
|
||||
user.deviceTrackingStatus = TRACKING_STATUS_OUTDATED;
|
||||
userIdentities.set(user);
|
||||
const user = await userIdentities.get(userId);
|
||||
if (user) {
|
||||
user.deviceTrackingStatus = TRACKING_STATUS_OUTDATED;
|
||||
userIdentities.set(user);
|
||||
} else {
|
||||
console.warn("changed device userid not found", userId);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user