--- a/WebBrowser/CookieJar/CookieJar.py Sat Feb 04 12:41:38 2017 +0100 +++ b/WebBrowser/CookieJar/CookieJar.py Sat Feb 04 13:10:20 2017 +0100 @@ -212,15 +212,16 @@ return True if self.__acceptCookies == self.AcceptOnlyFromSitesNavigatedTo: - url = WebBrowserWindow.mainWindow().getWindow().currentBrowser()\ - .url() - if url.isValid(): - host = url.host() - else: - host = "" - res = self.__matchDomain(cookieDomain, host) - if not res: - return True + 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 if self.__filterTrackingCookies and cookie.name().startsWith(b"__utm"): return True