From cabef7580e9cf492b924c652859edb1c27bae002 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 26 Jun 2013 14:02:45 +0200 Subject: [PATCH] Fix possible crash when looking for version control for directory Task-number: QTCREATORBUG-9656 Change-Id: If8babdb942830bd11fe360a311c57b75312248be Reviewed-by: Orgad Shaneh Reviewed-by: Jake Petroules --- src/plugins/coreplugin/vcsmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 31c3ae46f9d..97960dc178f 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -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()),