From: Christian Dywan Date: Wed, 18 Jul 2012 23:27:48 +0000 (+0200) Subject: Fix regression causing wrong tab URL "ghost" in urlbar X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5410468f1c2eb54f962c7ccaba3c351c5b7781;p=midori Fix regression causing wrong tab URL "ghost" in urlbar --- 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 }