changeset 12577:f1ee8a29bd69

[gaim-migrate @ 14899] I need to be able to destroy GaimChats that aren't attached to a group. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 20 Dec 2005 09:41:34 +0000
parents 1246935dd047
children 6609528f7099
files src/blist.c
diffstat 1 files changed, 18 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Tue Dec 20 09:35:56 2005 +0000
+++ b/src/blist.c	Tue Dec 20 09:41:34 2005 +0000
@@ -1830,22 +1830,25 @@
 	gnode = node->parent;
 	group = (GaimGroup *)gnode;
 
-	/* Remove the node from its parent */
-	if (gnode->child == node)
-		gnode->child = node->next;
-	if (node->prev)
-		node->prev->next = node->next;
-	if (node->next)
-		node->next->prev = node->prev;
-
-	/* Adjust size counts */
-	if (gaim_account_is_connected(chat->account)) {
-		group->online--;
-		group->currentsize--;
+	if (gnode != NULL)
+	{
+		/* Remove the node from its parent */
+		if (gnode->child == node)
+			gnode->child = node->next;
+		if (node->prev)
+			node->prev->next = node->next;
+		if (node->next)
+			node->next->prev = node->prev;
+
+		/* Adjust size counts */
+		if (gaim_account_is_connected(chat->account)) {
+			group->online--;
+			group->currentsize--;
+		}
+		group->totalsize--;
+
+		gaim_blist_schedule_save();
 	}
-	group->totalsize--;
-
-	gaim_blist_schedule_save();
 
 	/* Update the UI */
 	if (ops && ops->remove)