check the return value of webkit_web_history_item_get_title() to guard us

2008-07-22  Sven Neumann  <sven@gimp.org>

	* plug-ins/help-browser/dialog.c (build_menu): check the return
	value of webkit_web_history_item_get_title() to guard us against
	a (reported) bug in WebKit.


svn path=/trunk/; revision=26278
This commit is contained in:
Sven Neumann
2008-07-22 14:53:14 +00:00
committed by Sven Neumann
parent f3ffe972eb
commit 023fa1490c
2 changed files with 17 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2008-07-22 Sven Neumann <sven@gimp.org>
* plug-ins/help-browser/dialog.c (build_menu): check the return
value of webkit_web_history_item_get_title() to guard us against
a (reported) bug in WebKit.
2008-07-22 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpviewrendererimagefile.c

View File

@ -876,20 +876,23 @@ build_menu (GList *items)
for (list = items; list; list = g_list_next (list))
{
WebKitWebHistoryItem *item = list->data;
GtkWidget *menu_item;
const gchar *title;
title = webkit_web_history_item_get_title (item);
menu_item = gtk_menu_item_new_with_label (title);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
if (title)
{
GtkWidget *menu_item = gtk_menu_item_new_with_label (title);
g_signal_connect_object (menu_item, "activate",
G_CALLBACK (menu_callback),
item, 0);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
g_object_unref (item);
g_signal_connect_object (menu_item, "activate",
G_CALLBACK (menu_callback),
item, 0);
g_object_unref (item);
}
}
g_list_free (items);