Commit 6aeb1f99 authored by Tobias Hunger's avatar Tobias Hunger

VcsBase: Do not crash when no project is selected

Task-number: QTCREATORBUG-12242
Change-Id: I96e4ea8a547d3a3a30883efbe41cd63ff624b4c4
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 2a75c9c5
......@@ -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;
}
......
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