From a53d373e040ad74c0b5a783b6026e7baabb740e0 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 23 Jun 2009 19:52:47 +0200
Subject: [PATCH] don't traceback when we remove a contact that is alone in a
 metacontact. Fixes #4317

---
 src/roster_window.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/roster_window.py b/src/roster_window.py
index 92916b3179..5aa1434a6d 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -738,9 +738,11 @@ class RosterWindow:
 			# Remove contact before redrawing, otherwise the old
 			# numbers will still be show
 			gajim.contacts.remove_jid(account, jid, remove_meta=True)
-			if iters and family:
+			rest_of_family = [data for data in family
+				if account != data['account'] or jid != data['jid']]
+			if iters and rest_of_family:
 				# reshow the rest of the family
-				brothers = self._add_metacontact_family(family, account)
+				brothers = self._add_metacontact_family(rest_of_family, account)
 				for c, acc in brothers:
 					self.draw_completely(c.jid, acc)
 
-- 
GitLab