fix: Add missing null check

With Synapse 1.38 SyncUpdate.accountData is null if it is empty.
This commit is contained in:
Christian Pauly 2021-07-19 09:18:23 +02:00
parent 5b40088292
commit 99c900be9c
1 changed files with 4 additions and 2 deletions

View File

@ -484,7 +484,9 @@ class Bootstrap {
for (final entry in secretsToStore.entries) {
futures.add(
client.onSync.stream
.firstWhere((syncUpdate) => syncUpdate.accountData
.firstWhere((syncUpdate) =>
syncUpdate.accountData != null &&
syncUpdate.accountData
.any((accountData) => accountData.type == entry.key))
.then((_) =>
Logs().v('New Key with type ${entry.key} was created')),