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