From e17fb8ffc19d2b6269aca924cd82307fff3ae517 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jan 2015 16:19:36 +0100 Subject: [PATCH] Fix crash in insertSideBarWidget Change-Id: I7c35fe859b0364a7cd9cc5c4be6af60ab27cde17 Reviewed-by: Daniel Teske --- src/plugins/coreplugin/sidebar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/sidebar.cpp b/src/plugins/coreplugin/sidebar.cpp index 0822e3e2813..d48fe174f18 100644 --- a/src/plugins/coreplugin/sidebar.cpp +++ b/src/plugins/coreplugin/sidebar.cpp @@ -203,7 +203,8 @@ SideBarItem *SideBar::item(const QString &id) Internal::SideBarWidget *SideBar::insertSideBarWidget(int position, const QString &id) { - d->m_widgets.at(0)->setCloseIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_BOTTOM))); + if (!d->m_widgets.isEmpty()) + d->m_widgets.at(0)->setCloseIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_BOTTOM))); Internal::SideBarWidget *item = new Internal::SideBarWidget(this, id); connect(item, SIGNAL(splitMe()), this, SLOT(splitSubWidget()));