mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Fix crash during download when the main window have been closed
Summary: Falkon has a feature to automatically close the tab that was specifically opened for the file to download, because this kind of tab has no useful purpose to the user. In the case where the main window would have been closed, Falkon would crash de-referencing the now NULL pointer to the main window. This patch adds a simple check to do nothing in this case, as there is no tab to close anyway. Reviewers: #falkon, drosca Reviewed By: #falkon, drosca Subscribers: drosca, falkon, #falkon Tags: #falkon Differential Revision: https://phabricator.kde.org/D14711
This commit is contained in:
parent
b44134fd07
commit
907e2e4938
|
@ -142,8 +142,14 @@ void DownloadManager::closeDownloadTab(const QUrl &url) const
|
|||
return tabUrl.host() == url.host();
|
||||
};
|
||||
|
||||
if (testWebView(mApp->getWindow()->weView(), url)) {
|
||||
mApp->getWindow()->weView()->closeView();
|
||||
BrowserWindow* mainWindow = mApp->getWindow();
|
||||
// If the main window was closed, there is no need to go further
|
||||
if (mainWindow == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (testWebView(mainWindow->weView(), url)) {
|
||||
mainWindow->weView()->closeView();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user