Fix crash in insertSideBarWidget

Change-Id: I7c35fe859b0364a7cd9cc5c4be6af60ab27cde17
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
hjk
2015-01-21 16:19:36 +01:00
parent 58feec49bf
commit e17fb8ffc1

View File

@@ -203,7 +203,8 @@ SideBarItem *SideBar::item(const QString &id)
Internal::SideBarWidget *SideBar::insertSideBarWidget(int position, 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); Internal::SideBarWidget *item = new Internal::SideBarWidget(this, id);
connect(item, SIGNAL(splitMe()), this, SLOT(splitSubWidget())); connect(item, SIGNAL(splitMe()), this, SLOT(splitSubWidget()));