]> spindle.queued.net Git - midori/commitdiff
Check if typed link number exists and check result
authorChristian Dywan <christian@twotoasts.de>
Sat, 1 Jan 2011 18:03:00 +0000 (19:03 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 1 Jan 2011 18:25:21 +0000 (19:25 +0100)
midori/midori-view.c

index 7f4a949573040f786263c0f47fb400d051bc6fbe..fad15bf59676f021e1c92fece21eaadfbb35e5db 100644 (file)
@@ -1861,10 +1861,11 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
                 "if (return_key || typeof links[i * 10] == 'undefined') {"
                 "    for (var j = 0; j < links.length; j++)"
                 "        links[j].style.display = 'none !important';"
-                "    links[i].parentNode.href; }",
+                "    if (typeof links[i] != 'undefined')"
+                "        links[i].parentNode.href; }",
                 view->find_links, event->keyval == GDK_Return);
             result = sokoke_js_script_eval (js_context, script, NULL);
-            if (strcmp (result, "undefined"))
+            if (result && strstr (result, "://"))
             {
                 view->find_links = -1;
                 if (MIDORI_MOD_NEW_TAB (event->state))