1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

[code] Added checks before using QWebPage::view().

This commit is contained in:
nowrep 2013-02-07 14:38:31 +01:00
parent 312a86d584
commit 3b648397b0

View File

@ -507,7 +507,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &r
if (type == QWebPage::NavigationTypeFormResubmitted) {
// Don't show this dialog if app is still starting
if (!view()->isVisible()) {
if (!view() || !view()->isVisible()) {
return false;
}
QString message = tr("To show this page, QupZilla must resend request which do it again \n"
@ -611,7 +611,7 @@ void WebPage::cleanBlockedObjects()
}
// Apply domain-specific element hiding rules
QString elementHiding = AdBlockManager::instance()->elementHidingRulesForDomain(url());
QString elementHiding = manager->elementHidingRulesForDomain(url());
if (elementHiding.isEmpty()) {
return;
}
@ -623,7 +623,7 @@ void WebPage::cleanBlockedObjects()
// When hiding some elements, scroll position of page will change
// If user loaded anchor link in background tab (and didn't show it yet), fix the scroll position
if (!view()->isVisible() && !url().fragment().isEmpty()) {
if (view() && !view()->isVisible() && !url().fragment().isEmpty()) {
mainFrame()->scrollToAnchor(url().fragment());
}
}