# HG changeset patch # User Daniel Atallah # Date 1176773886 0 # Node ID 6118bd3c9a7c42a2203af35f37d92ab47bf08218 # Parent 9d9ddc45c07b0c9dd18fdd002ae06900a78b5ede Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias. diff -r 9d9ddc45c07b -r 6118bd3c9a7c pidgin/gtklog.c --- a/pidgin/gtklog.c Mon Apr 16 23:19:38 2007 +0000 +++ b/pidgin/gtklog.c Tue Apr 17 01:38:06 2007 +0000 @@ -723,15 +723,25 @@ } logs = g_list_sort(logs, purple_log_compare); - pixbuf = gtk_widget_render_icon (image, PIDGIN_STOCK_STATUS_PERSON, - gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), "GtkWindow"); + pixbuf = gtk_widget_render_icon(image, PIDGIN_STOCK_STATUS_PERSON, + gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), "GtkWindow"); gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); - + if (contact->alias != NULL) name = contact->alias; else if (contact->priority != NULL) name = purple_buddy_get_contact_alias(contact->priority); + /* This will happen if the contact doesn't have an alias, + * and none of the contact's buddies are online. + * There is probably a better way to deal with this. */ + if (name == NULL) { + if (contact->node.child != NULL && PURPLE_BLIST_NODE_IS_BUDDY(contact->node.child)) + name = purple_buddy_get_contact_alias((PurpleBuddy *) contact->node.child); + if (name == NULL) + name = ""; + } + title = g_strdup_printf(_("Conversations with %s"), name); display_log_viewer(ht, logs, title, image, total_log_size); g_free(title);