Commit 55052fcc authored by Alexander Semke's avatar Alexander Semke
Browse files

Don't crash when openning an invalid project file from an invalid URL.

parent 611d31c4
Pipeline #117313 passed with stage
in 18 minutes and 51 seconds
/*
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2009 Alexander Rieder <alexanderrieder@gmail.com>
SPDX-FileCopyrightText: 2018-2021 Alexander Semke <alexander.semke@web.de>
SPDX-FileCopyrightText: 2018-2022 Alexander Semke <alexander.semke@web.de>
*/
#include "cantor.h"
#include "lib/session.h"
......@@ -113,13 +113,13 @@ void CantorShell::load(const QUrl& url)
m_tabWidget->setCurrentIndex(m_parts.size() - 1);
}
if (!m_part->openUrl(url))
closeTab(m_tabWidget->currentIndex());
if (m_recentProjectsAction)
m_recentProjectsAction->addUrl(url);
if (m_part->openUrl(url)) {
if (m_recentProjectsAction)
m_recentProjectsAction->addUrl(url);
updateWindowTitle(m_part->url().fileName());
updateWindowTitle(m_part->url().fileName());
} else
closeTab(m_tabWidget->currentIndex());
}
void CantorShell::setupActions()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment