forked from qt-creator/qt-creator
StudioWelcome: fix crash when opening nonexistent recent projects
Task-number: QDS-10085 Change-Id: I038c95f1a5d0975c0f39bb275a6e2f5a2c05c8d6 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -422,8 +422,11 @@ static QString tags(const FilePath &projectFilePath)
|
||||
|
||||
QVariant ProjectModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (index.row() >= ProjectExplorer::ProjectExplorerPlugin::recentProjects().count())
|
||||
if (!index.isValid() ||
|
||||
index.row() >= ProjectExplorer::ProjectExplorerPlugin::recentProjects().count()) {
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
const ProjectExplorer::RecentProjectsEntry data =
|
||||
ProjectExplorer::ProjectExplorerPlugin::recentProjects().at(index.row());
|
||||
|
Reference in New Issue
Block a user