Fix possible crash when looking for version control for directory

Task-number: QTCREATORBUG-9656

Change-Id: If8babdb942830bd11fe360a311c57b75312248be
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
This commit is contained in:
Eike Ziller
2013-06-26 14:02:45 +02:00
parent 52eb3c4326
commit cabef7580e

View File

@@ -287,8 +287,8 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input
}
return versionControl;
} else {
InfoBar *infoBar = curDocument->infoBar();
if (infoBar->canInfoBeAdded(vcsWarning)) {
InfoBar *infoBar = curDocument ? curDocument->infoBar() : 0;
if (infoBar && infoBar->canInfoBeAdded(vcsWarning)) {
InfoBarEntry info(vcsWarning,
tr("%1 repository was detected but %1 is not configured.")
.arg(versionControl->displayName()),