fix: Check if client is disposed in a callback

This fixed an edge case in the tests.
This commit is contained in:
Christian Pauly 2021-09-02 08:40:02 +02:00 committed by Krille Fear
parent d921f38734
commit fb62307730
1 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,9 @@ class KeyManager {
json.encode(senderClaimedKeys), json.encode(senderClaimedKeys),
) )
?.then((_) { ?.then((_) {
if (!client.isLogged() || client.encryption == null) {
return;
}
if (uploaded) { if (uploaded) {
client.database client.database
.markInboundGroupSessionAsUploaded(client.id, roomId, sessionId); .markInboundGroupSessionAsUploaded(client.id, roomId, sessionId);