--- a/WebBrowser/CookieJar/CookieJar.py Sun Jul 02 19:40:39 2017 +0200 +++ b/WebBrowser/CookieJar/CookieJar.py Mon Jul 03 19:23:54 2017 +0200 @@ -214,14 +214,16 @@ if self.__acceptCookies == self.AcceptOnlyFromSitesNavigatedTo: mainWindow = WebBrowserWindow.mainWindow() if mainWindow is not None: - url = mainWindow.getWindow().currentBrowser().url() - if url.isValid(): - host = url.host() - else: - host = "" - res = self.__matchDomain(cookieDomain, host) - if not res: - return True + browser = mainWindow.getWindow().currentBrowser() + if browser is not None: + url = browser.url() + if url.isValid(): + host = url.host() + else: + host = "" + res = self.__matchDomain(cookieDomain, host) + if not res: + return True if self.__filterTrackingCookies and cookie.name().startsWith(b"__utm"): return True