fix: Missing null checks in syncUpdate handling
This commit is contained in:
parent
46b2f8898e
commit
e8d511a371
|
|
@ -233,6 +233,7 @@ class SSSS {
|
||||||
final accountDataType = EventTypes.secretStorageKey(keyId);
|
final accountDataType = EventTypes.secretStorageKey(keyId);
|
||||||
// noooow we set the account data
|
// noooow we set the account data
|
||||||
final waitForAccountData = client.onSync.stream.firstWhere((syncUpdate) =>
|
final waitForAccountData = client.onSync.stream.firstWhere((syncUpdate) =>
|
||||||
|
syncUpdate.accountData != null &&
|
||||||
syncUpdate.accountData
|
syncUpdate.accountData
|
||||||
.any((accountData) => accountData.type == accountDataType));
|
.any((accountData) => accountData.type == accountDataType));
|
||||||
await client.setAccountData(
|
await client.setAccountData(
|
||||||
|
|
|
||||||
|
|
@ -290,6 +290,7 @@ class Bootstrap {
|
||||||
// alright, we re-encrypted all the secrets. We delete the dead weight only *after* we set our key to the default key
|
// alright, we re-encrypted all the secrets. We delete the dead weight only *after* we set our key to the default key
|
||||||
}
|
}
|
||||||
final updatedAccountData = client.onSync.stream.firstWhere((syncUpdate) =>
|
final updatedAccountData = client.onSync.stream.firstWhere((syncUpdate) =>
|
||||||
|
syncUpdate.accountData != null &&
|
||||||
syncUpdate.accountData.any((accountData) =>
|
syncUpdate.accountData.any((accountData) =>
|
||||||
accountData.type == EventTypes.SecretStorageDefaultKey));
|
accountData.type == EventTypes.SecretStorageDefaultKey));
|
||||||
await encryption.ssss.setDefaultKeyId(newSsssKey.keyId);
|
await encryption.ssss.setDefaultKeyId(newSsssKey.keyId);
|
||||||
|
|
|
||||||
|
|
@ -647,7 +647,7 @@ class Client extends MatrixApi {
|
||||||
filter: '{"room":{"include_leave":true,"timeline":{"limit":10}}}',
|
filter: '{"room":{"include_leave":true,"timeline":{"limit":10}}}',
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
);
|
);
|
||||||
if (syncResp.rooms.leave is Map<String, dynamic>) {
|
if (syncResp.rooms?.leave != null) {
|
||||||
for (final entry in syncResp.rooms.leave.entries) {
|
for (final entry in syncResp.rooms.leave.entries) {
|
||||||
final id = entry.key;
|
final id = entry.key;
|
||||||
final room = entry.value;
|
final room = entry.value;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue