diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index d5ad29e44a2..f1e9ac284d2 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -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());