Skip to content
Snippets Groups Projects
Commit 6aeb1f99 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

VcsBase: Do not crash when no project is selected


Task-number: QTCREATORBUG-12242
Change-Id: I96e4ea8a547d3a3a30883efbe41cd63ff624b4c4
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
parent 2a75c9c5
No related branches found
No related tags found
No related merge requests found
......@@ -147,8 +147,13 @@ void VcsPlugin::updateVariable(const QByteArray &variable)
ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject();
if (cachedProject != project) {
cachedVc = Core::VcsManager::findVersionControlForDirectory(project->projectDirectory(),
&cachedTopLevel);
if (project) {
cachedVc = Core::VcsManager::findVersionControlForDirectory(project->projectDirectory(),
&cachedTopLevel);
} else {
cachedVc = 0;
cachedTopLevel.clear();
}
cachedProject = project;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment