pidgin: d1d77da5: Rearrange code to prevent a NULL-deferen...

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 22 04:41:57 EST 2011


----------------------------------------------------------------------
Revision: d1d77da56217f3a083e1d459bef054db9f1d5699
Parent:   10ead4688e3af4132d454fa3bc241480500651c9
Author:   qulogic at pidgin.im
Date:     12/21/11 20:13:20
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d1d77da56217f3a083e1d459bef054db9f1d5699

Changelog: 

Rearrange code to prevent a NULL-deference. Thanks to clh for
pointing out this issue.

Closes #14392.

Changes against parent 10ead4688e3af4132d454fa3bc241480500651c9

  patched  pidgin/gtkconv.c

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	465691e380ea015c4c6a78cfb96c735fa7f79846
+++ pidgin/gtkconv.c	b9250e4e741f0f12694c831518fbb1192d817698
@@ -6624,7 +6624,15 @@ pidgin_conv_chat_rename_user(PurpleConve
 	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 = purple_conv_chat_cb_get_ui_data(old_cbuddy);
 
@@ -6633,14 +6641,6 @@ pidgin_conv_chat_rename_user(PurpleConve
 		purple_conv_chat_cb_set_ui_data(old_cbuddy, 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);


More information about the Commits mailing list