# HG changeset patch # User Elliott Sales de Andrade # Date 1324516400 0 # Node ID 3ea785e1cc22778f71dfdc150eaf8cd3eba4e9d6 # Parent 490ad537b77f779494db1fc7ea8a420d3266db6d Rearrange code to prevent a NULL-deference. Thanks to clh for pointing out this issue. Closes #14392. diff -r 490ad537b77f -r 3ea785e1cc22 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Thu Dec 22 00:50:40 2011 +0000 +++ b/pidgin/gtkconv.c Thu Dec 22 01:13:20 2011 +0000 @@ -6624,7 +6624,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 = purple_conv_chat_cb_get_ui_data(old_cbuddy); @@ -6633,14 +6641,6 @@ 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);