Bugfix: list index out of range when opening service discovery

Fixes #9301
This commit is contained in:
pitchum 2018-09-02 22:18:42 +02:00 committed by Philipp Hörist
parent 7a8892f021
commit 9a2d915d5d
1 changed files with 7 additions and 4 deletions

View File

@ -1569,11 +1569,14 @@ class ToplevelAgentBrowser(AgentBrowser):
def _update_info(self, iter_, jid, node, identities, features, data):
addr = get_agent_address(jid, node)
name = identities[0].get('name', '')
if name:
descr = "<b>%s</b>\n%s" % (name, addr)
else:
if not identities:
descr = "<b>%s</b>" % addr
else:
name = identities[0].get('name', '')
if name:
descr = "<b>%s</b>\n%s" % (name, addr)
else:
descr = "<b>%s</b>" % addr
# Update progress
self._progress += 1