changeset 32519:13d06d60fc49

*** Plucked rev d1d77da56217f3a083e1d459bef054db9f1d5699 (qulogic@pidgin.im): Rearrange code to prevent a NULL-deference. Thanks to clh for pointing out this issue. Closes #14392.
author Mark Doliner <mark@kingant.net>
date Sat, 18 Feb 2012 23:00:10 +0000
parents 0087049160ad
children 2c93bd1582a1
files pidgin/gtkconv.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Wed Feb 15 22:27:43 2012 +0000
+++ b/pidgin/gtkconv.c	Sat Feb 18 23:00:10 2012 +0000
@@ -6216,7 +6216,15 @@
 	if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
 		return;
 
+	if ((tag = get_buddy_tag(conv, old_name, 0, FALSE)))
+		g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL);
+	if ((tag = get_buddy_tag(conv, old_name, PURPLE_MESSAGE_NICK, FALSE)))
+		g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL);
+
 	old_cbuddy = purple_conv_chat_cb_find(chat, old_name);
+	if (!old_cbuddy)
+		return;
+
 	if (get_iter_from_chatbuddy(old_cbuddy, &iter)) {
 		GtkTreeRowReference *ref = old_cbuddy->ui_data;
 
@@ -6225,14 +6233,6 @@
 		old_cbuddy->ui_data = NULL;
 	}
 
-	if ((tag = get_buddy_tag(conv, old_name, 0, FALSE)))
-		g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL);
-	if ((tag = get_buddy_tag(conv, old_name, PURPLE_MESSAGE_NICK, FALSE)))
-		g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL);
-
-	if (!old_cbuddy)
-		return;
-
 	g_return_if_fail(new_alias != NULL);
 
 	new_cbuddy = purple_conv_chat_cb_find(chat, new_name);