changeset c79771e52459 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=c79771e52459 description: do not crash when we remove a contact for which neerby contcts are not in the same accounts. Fixes #8157
diffstat:
src/common/contacts.py | 2 ++ src/roster_window.py | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-)
diffs (24 lines):
diff -r 467341adb843 -r c79771e52459 src/common/contacts.py --- a/src/common/contacts.py Sun Nov 15 14:28:31 2015 +0100 +++ b/src/common/contacts.py Sun Nov 15 21:07:02 2015 +0100 @@ -836,6 +836,8 @@ # we want one nearby_family per account nearby_family = [data for data in family if account == data['account']]
+ if not nearby_family: + return (None, None, None) big_brother_data = self._get_metacontacts_big_brother(nearby_family) big_brother_jid = big_brother_data['jid'] big_brother_account = big_brother_data['account'] diff -r 467341adb843 -r c79771e52459 src/roster_window.py --- a/src/roster_window.py Sun Nov 15 14:28:31 2015 +0100 +++ b/src/roster_window.py Sun Nov 15 21:07:02 2015 +0100 @@ -476,6 +476,8 @@
nearby_family, big_brother_jid, big_brother_account = \ self._get_nearby_family_and_big_brother(family, account) + if not big_brother_jid: + return [] big_brother_contact = gajim.contacts.get_first_contact_from_jid( big_brother_account, big_brother_jid)