fix traceback when we get bookmarks and roster is not present.

This commit is contained in:
Yann Leboulanger 2009-07-12 15:13:17 +02:00
parent 15b3ba35b1
commit 7a976135e2
1 changed files with 13 additions and 12 deletions

View File

@ -569,21 +569,22 @@ class RosterWindow:
big_brother_jid) big_brother_jid)
child_iters = self._get_contact_iter(big_brother_jid, big_brother_account, child_iters = self._get_contact_iter(big_brother_jid, big_brother_account,
model=self.model) model=self.model)
parent_iter = self.model.iter_parent(child_iters[0]) if child_iters:
parent_type = self.model[parent_iter][C_TYPE] parent_iter = self.model.iter_parent(child_iters[0])
parent_type = self.model[parent_iter][C_TYPE]
# Check if the current BigBrother has even been before. # Check if the current BigBrother has even been before.
if parent_type == 'contact': if parent_type == 'contact':
for data in nearby_family: for data in nearby_family:
# recalibrate after remove to keep highlight # recalibrate after remove to keep highlight
if data['jid'] in gajim.to_be_removed[data['account']]: if data['jid'] in gajim.to_be_removed[data['account']]:
return return
self._remove_metacontact_family(family, account) self._remove_metacontact_family(family, account)
brothers = self._add_metacontact_family(family, account) brothers = self._add_metacontact_family(family, account)
for c, acc in brothers: for c, acc in brothers:
self.draw_completely(c.jid, acc) self.draw_completely(c.jid, acc)
# Check is small brothers are under the big brother # Check is small brothers are under the big brother
for child in nearby_family: for child in nearby_family: