fix: missing null check
It seems `device_keys` in the reply of `/keys/query` is not required. While synapse always sent it, conduit did not, which resulted in an error.
This commit is contained in:
parent
7155500594
commit
56817df437
|
|
@ -1663,15 +1663,17 @@ sort order of ${prevState.sortOrder}. This should never happen...''');
|
|||
final response = await queryKeys(outdatedLists, timeout: 10000);
|
||||
if (!isLogged()) return;
|
||||
|
||||
if (response.deviceKeys != null) {
|
||||
for (final rawDeviceKeyListEntry in response.deviceKeys.entries) {
|
||||
final userId = rawDeviceKeyListEntry.key;
|
||||
if (!userDeviceKeys.containsKey(userId)) {
|
||||
_userDeviceKeys[userId] = DeviceKeysList(userId, this);
|
||||
}
|
||||
final oldKeys =
|
||||
Map<String, DeviceKeys>.from(_userDeviceKeys[userId].deviceKeys);
|
||||
final oldKeys = Map<String, DeviceKeys>.from(
|
||||
_userDeviceKeys[userId].deviceKeys);
|
||||
_userDeviceKeys[userId].deviceKeys = {};
|
||||
for (final rawDeviceKeyEntry in rawDeviceKeyListEntry.value.entries) {
|
||||
for (final rawDeviceKeyEntry
|
||||
in rawDeviceKeyListEntry.value.entries) {
|
||||
final deviceId = rawDeviceKeyEntry.key;
|
||||
|
||||
// Set the new device key for this device
|
||||
|
|
@ -1729,8 +1731,9 @@ sort order of ${prevState.sortOrder}. This should never happen...''');
|
|||
}
|
||||
_userDeviceKeys[userId].outdated = false;
|
||||
if (database != null) {
|
||||
dbActions
|
||||
.add(() => database.storeUserDeviceKeysInfo(id, userId, false));
|
||||
dbActions.add(
|
||||
() => database.storeUserDeviceKeysInfo(id, userId, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
// next we parse and persist the cross signing keys
|
||||
|
|
|
|||
Loading…
Reference in New Issue