]> spindle.queued.net Git - midori/commitdiff
Check if 'search engines' are actually set
authorChristian Dywan <christian@twotoasts.de>
Thu, 19 Feb 2009 22:40:00 +0000 (23:40 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 19 Feb 2009 22:40:00 +0000 (23:40 +0100)
midori/midori-searchaction.c

index a7a16fc5a3cc3be0dae0d9479b38c1ecf3cc95b5..6b71f1ff31425611943dd49929859992bff446ca 100644 (file)
@@ -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;