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()));