# HG changeset patch # User Goffi # Date 1652462130 -7200 # Node ID ea204216a505ad382ac79b0d06aa27dfc6f0b48f # Parent 125c7043b27798babaeb1f7fc255a94d5b448b90 CLI: don't fail when calling `getContacts` with a component profile diff -r 125c7043b277 -r ea204216a505 sat_frontends/jp/base.py --- a/sat_frontends/jp/base.py Fri May 13 19:12:33 2022 +0200 +++ b/sat_frontends/jp/base.py Fri May 13 19:15:30 2022 +0200 @@ -801,7 +801,17 @@ 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: