From: Christian Dywan Date: Thu, 19 Feb 2009 22:40:00 +0000 (+0100) Subject: Check if 'search engines' are actually set X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=514c6965c74276ff3c9542e166a034990bb5f1dc;p=midori Check if 'search engines' are actually set --- diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c index a7a16fc5..6b71f1ff 100644 --- a/midori/midori-searchaction.c +++ b/midori/midori-searchaction.c @@ -1131,7 +1131,8 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action) gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); 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++) { item = katze_array_get_nth_item (search_action->search_engines, i); @@ -1187,12 +1188,13 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action) #endif gtk_widget_show_all (GTK_DIALOG (dialog)->vbox); - g_object_connect (search_action->search_engines, - "signal-after::add-item", - midori_search_action_dialog_engines_add_item_cb, search_action, - "signal-after::remove-item", - midori_search_action_dialog_engines_remove_item_cb, search_action, - NULL); + if (search_action->search_engines) + g_object_connect (search_action->search_engines, + "signal-after::add-item", + midori_search_action_dialog_engines_add_item_cb, search_action, + "signal-after::remove-item", + midori_search_action_dialog_engines_remove_item_cb, search_action, + NULL); search_action->dialog = dialog; return dialog;