From 630203e7b68bfaf96d933c94e3c0d3fc6c5b4dcb Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 3 Sep 2021 15:05:34 +0200 Subject: [PATCH] fix: Check if database got disposed in keyManager --- 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 6133d91d..70a6f18b 100644 --- a/lib/encryption/key_manager.dart +++ b/lib/encryption/key_manager.dart @@ -144,6 +144,9 @@ class KeyManager { _inboundGroupSessions[roomId] = {}; } _inboundGroupSessions[roomId][sessionId] = newSession; + if (!client.isLogged() || client.encryption == null) { + return; + } client.database ?.storeInboundGroupSession( client.id,