don't remove an item that isn't in the layout

svn path=/trunk/KDE/kdelibs/; revision=1100924
This commit is contained in:
Aaron J. Seigo 2010-03-09 00:12:31 +00:00
parent 6842d43101
commit bb75767105

View File

@ -219,7 +219,7 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
(f == Plasma::Vertical || f == Plasma::Horizontal))) { (f == Plasma::Vertical || f == Plasma::Horizontal))) {
QGraphicsLinearLayout *lay = dynamic_cast<QGraphicsLinearLayout *>(q->layout()); QGraphicsLinearLayout *lay = dynamic_cast<QGraphicsLinearLayout *>(q->layout());
if (icon && !icon->icon().isNull() && lay) { if (icon && !icon->icon().isNull() && lay && lay->count() > 0) {
lay->removeAt(0); lay->removeAt(0);
} }