From fb62307730de85089f7cd27ab25c55ad99564404 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 2 Sep 2021 08:40:02 +0200 Subject: [PATCH] fix: Check if client is disposed in a callback This fixed an edge case in the tests. --- lib/encryption/key_manager.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/encryption/key_manager.dart b/lib/encryption/key_manager.dart index 86d93e18..6133d91d 100644 --- a/lib/encryption/key_manager.dart +++ b/lib/encryption/key_manager.dart @@ -157,6 +157,9 @@ class KeyManager { json.encode(senderClaimedKeys), ) ?.then((_) { + if (!client.isLogged() || client.encryption == null) { + return; + } if (uploaded) { client.database .markInboundGroupSessionAsUploaded(client.id, roomId, sessionId);