From 1ac08130edfc7d5fbd5451684bcfa233e09bb458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 11 Mar 2020 01:32:39 +0100 Subject: [PATCH] Ensure `expect_problems` is a dict within encrypt_message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp_omemo/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 1f6d978..6521c3e 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -579,8 +579,10 @@ class XEP_0384(BasePlugin): # or if we hit the same set of errors. errors = [] # type: List[omemo.exceptions.OMEMOException] - if expect_problems is not None: - expect_problems = {jid.bare: did for (jid, did) in expect_problems.items()} + if expect_problems is None: + expect_problems = {} + + expect_problems = {jid.bare: did for (jid, did) in expect_problems.items()} try: encrypted = self._omemo.encryptMessage(