Check if 'search engines' are actually set

This commit is contained in:
Christian Dywan 2009-02-19 23:40:00 +01:00
parent 4ab9bd74e7
commit 514c6965c7

View file

@ -1131,7 +1131,8 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_IN); GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), scrolled, TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), scrolled, TRUE, TRUE, 5);
n = katze_array_get_length (search_action->search_engines); n = search_action->search_engines ?
katze_array_get_length (search_action->search_engines) : 0;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
item = katze_array_get_nth_item (search_action->search_engines, i); item = katze_array_get_nth_item (search_action->search_engines, i);
@ -1187,6 +1188,7 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action)
#endif #endif
gtk_widget_show_all (GTK_DIALOG (dialog)->vbox); gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
if (search_action->search_engines)
g_object_connect (search_action->search_engines, g_object_connect (search_action->search_engines,
"signal-after::add-item", "signal-after::add-item",
midori_search_action_dialog_engines_add_item_cb, search_action, midori_search_action_dialog_engines_add_item_cb, search_action,