]> spindle.queued.net Git - midori/commitdiff
Return no search engine if there's no form
authorPaweł Forysiuk <tuxator@o2.pl>
Fri, 10 Aug 2012 16:46:41 +0000 (18:46 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 10 Aug 2012 17:11:36 +0000 (19:11 +0200)
Such as http://valadoc.org/#!wiki=index

midori/midori-view.c

index 4fd9ce391c40cf37d14458303a34c3debe6f0096..d4d56ea5e00afadbe31f9a1db375a88baddc6162 100644 (file)
@@ -2471,6 +2471,10 @@ midori_view_search_engine_for_form (MidoriView*    view,
 
     active_element = webkit_dom_html_document_get_active_element ((WebKitDOMHTMLDocument*)doc);
     active_form = webkit_dom_html_input_element_get_form ((WebKitDOMHTMLInputElement*)active_element);
+
+    if (!active_form)
+        return NULL;
+
     token_element = webkit_dom_element_get_attribute (active_element, "name");
 
     form_nodes = webkit_dom_html_form_element_get_elements (active_form);