From 4323931309af6180f37515601950c1496722650a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 13 Jul 2018 15:46:21 +0200 Subject: [PATCH] encryption: Return a tuple as well if no decryption session is found. --- matrix/encryption.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/matrix/encryption.py b/matrix/encryption.py index 6c09e12..851baf7 100644 --- a/matrix/encryption.py +++ b/matrix/encryption.py @@ -649,13 +649,16 @@ class Olm(): @encrypt_enabled def group_decrypt(self, room_id, session_id, ciphertext): if session_id not in self.inbound_group_sessions[room_id]: - return None + return None, None session = self.inbound_group_sessions[room_id][session_id] + try: return session.decrypt(ciphertext) except OlmGroupSessionError: - return None, None + pass + + return None, None def share_group_session(self, room_id, own_id, users): group_session = self.outbound_group_sessions[room_id]