From 99c900be9ca4a03abd12930d6c84909801eec974 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 19 Jul 2021 09:18:23 +0200 Subject: [PATCH] fix: Add missing null check With Synapse 1.38 SyncUpdate.accountData is null if it is empty. --- lib/encryption/utils/bootstrap.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/encryption/utils/bootstrap.dart b/lib/encryption/utils/bootstrap.dart index 2ffa4b6c..63e912ad 100644 --- a/lib/encryption/utils/bootstrap.dart +++ b/lib/encryption/utils/bootstrap.dart @@ -484,8 +484,10 @@ class Bootstrap { for (final entry in secretsToStore.entries) { futures.add( client.onSync.stream - .firstWhere((syncUpdate) => syncUpdate.accountData - .any((accountData) => accountData.type == entry.key)) + .firstWhere((syncUpdate) => + syncUpdate.accountData != null && + syncUpdate.accountData + .any((accountData) => accountData.type == entry.key)) .then((_) => Logs().v('New Key with type ${entry.key} was created')), );