From 7c5410468f1c2eb54f962c7ccaba3c351c5b7781 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 19 Jul 2012 01:27:48 +0200 Subject: [PATCH] Fix regression causing wrong tab URL "ghost" in urlbar --- midori/midori-browser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 7a307667..d137765c 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -8054,6 +8054,8 @@ midori_browser_get_current_tab (MidoriBrowser* browser) { #ifdef HAVE_GRANITE GraniteWidgetsTab* tab; + #else + gint n; #endif g_return_val_if_fail (MIDORI_IS_BROWSER (browser), NULL); @@ -8063,8 +8065,8 @@ midori_browser_get_current_tab (MidoriBrowser* browser) GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (browser->notebook)); return tab ? granite_widgets_tab_get_page (tab) : NULL; #else - return midori_browser_get_nth_tab (browser, - midori_browser_get_current_page (browser)); + n = midori_browser_get_current_page (browser); + return (n >= 0) ? midori_browser_get_nth_tab (browser, n) : NULL; #endif }