Add safety check for invalid ModelIndex

With the new QML tabbox it could happen that the index is not
valid and nothing is selected in the view.
This commit is contained in:
Martin Gräßlin 2011-11-04 19:27:02 +01:00
parent 6698801cb5
commit ba98af770a

View file

@ -534,6 +534,9 @@ void TabBoxHandler::setCurrentIndex(const QModelIndex& index)
if (d->index == index) {
return;
}
if (!index.isValid()) {
return;
}
if (d->view) {
d->view->setCurrentIndex(index);
}