changeset 32814:626c339b60ae

Fix crash when ignoring message from a user not in the room. Fixes #15139 Occurs with IRC system messages on-login.
author Paul Aurich <paul@darkrain42.org>
date Thu, 31 May 2012 03:45:21 +0000
parents 0d8e718cdb64
children 3d6528f36877 6fa0e854cfc6
files ChangeLog pidgin/gtkconv.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon May 14 03:02:20 2012 +0000
+++ b/ChangeLog	Thu May 31 03:45:21 2012 +0000
@@ -1,7 +1,9 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.10.5:
-	No changes
+	Pidgin:
+	* Fix a crash that may occur when trying to ignore a user who is
+	  not in the current chat room. (#15139)
 
 version 2.10.4 (05/06/2012):
 	General:
--- a/pidgin/gtkconv.c	Mon May 14 03:02:20 2012 +0000
+++ b/pidgin/gtkconv.c	Thu May 31 03:45:21 2012 +0000
@@ -6132,10 +6132,13 @@
 
 static gboolean get_iter_from_chatbuddy(PurpleConvChatBuddy *cb, GtkTreeIter *iter)
 {
-	GtkTreeRowReference *ref = cb->ui_data;
+	GtkTreeRowReference *ref;
 	GtkTreePath *path;
 	GtkTreeModel *model;
 
+	g_return_val_if_fail(cb != NULL, FALSE);
+
+	ref = cb->ui_data;
 	if (!ref)
 		return FALSE;
 
@@ -6315,6 +6318,9 @@
 		return;
 
 	cbuddy = purple_conv_chat_cb_find(chat, user);
+	if (!cbuddy)
+		return;
+
 	if (get_iter_from_chatbuddy(cbuddy, &iter)) {
 		GtkTreeRowReference *ref = cbuddy->ui_data;
 		gtk_list_store_remove(GTK_LIST_STORE(model), &iter);