From a2a287ee5d3e997ad033b2aad38f176e64acf58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 16 Jul 2021 21:49:55 +0200 Subject: [PATCH] don't include empty sessions in _chain_lengths method 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 8fbc658..841a46a 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -532,6 +532,8 @@ class XEP_0384(BasePlugin): lengths: ChainLengths = {'sending': [], 'receiving': []} for did in devices: session = self._omemo._SessionManager__loadSession(bare, did) + if session is None: + break skr = session._DoubleRatchet__skr lengths['sending'].append((did, skr.sending_chain_length)) lengths['receiving'].append((did, skr.receiving_chain_length))