fix variable initialization. Fixes #7551

This commit is contained in:
Yann Leboulanger 2013-11-06 19:02:37 +01:00
parent ac5e65b3b6
commit a0e84e08cf
1 changed files with 8 additions and 7 deletions

View File

@ -948,14 +948,15 @@ class AgentBrowser:
Set the window title based on agent info
"""
# Set the banner and window title
name = ''
if len(identities) > 1:
# Check if an identity with server category is present
for i, _identity in enumerate(identities):
if _identity['category'] == 'server' and 'name' in _identity:
name = _identity['name']
break
elif 'name' in identities[0]:
name = identities[0]['name']
# Check if an identity with server category is present
for i, _identity in enumerate(identities):
if _identity['category'] == 'server' and 'name' in _identity:
name = _identity['name']
break
elif 'name' in identities[0]:
name = identities[0]['name']
if name:
self.window._set_window_banner_text(self._get_agent_address(), name)