From da7a90abd21e4c873225bf60dc3943f4d4a94843 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 13 May 2022 19:15:30 +0200 Subject: [PATCH] CLI: don't fail when calling `getContacts` with a component profile --- sat_frontends/jp/base.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sat_frontends/jp/base.py b/sat_frontends/jp/base.py index 958a76f7..7213bb76 100644 --- a/sat_frontends/jp/base.py +++ b/sat_frontends/jp/base.py @@ -801,7 +801,17 @@ class LiberviaCli: names2jid = {} nodes2jid = {} - for contact in await self.bridge.getContacts(self.profile): + try: + contacts = await self.bridge.getContacts(self.profile) + except BridgeException as e: + if e.classname == "AttributeError": + # we may get an AttributeError if we use a component profile + # as components don't have roster + contacts = [] + else: + raise e + + for contact in contacts: jid_s, attr, groups = contact _jid = JID(jid_s) try: