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:
parent
6698801cb5
commit
ba98af770a
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue