Commit 62554e76 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Add a soft assertion

If directory is empty, buttons remains NULL, which leads to a crash

To reproduce, open Branches dialog then close all editors
and projects and click Log for a branch

Change-Id: Icf06b76c58585c0dd6062017e94e07dad016c275
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent e6c85d5f
...@@ -632,6 +632,7 @@ public: ...@@ -632,6 +632,7 @@ public:
m_enableAnnotationContextMenu(enableAnnotationContextMenu), m_enableAnnotationContextMenu(enableAnnotationContextMenu),
m_fileNames(fileNames) m_fileNames(fileNames)
{ {
QTC_ASSERT(!directory.isEmpty(), return);
QToolButton *diffButton = addToggleButton(QLatin1String("--patch"), tr("Show Diff"), QToolButton *diffButton = addToggleButton(QLatin1String("--patch"), tr("Show Diff"),
tr("Show difference.")); tr("Show difference."));
mapSetting(diffButton, m_client->settings()->boolPointer(GitSettings::logDiffKey)); mapSetting(diffButton, m_client->settings()->boolPointer(GitSettings::logDiffKey));
......
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