From ba98af770af4d8f83a8a21ea58b0b0636b3ecdd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 4 Nov 2011 19:27:02 +0100 Subject: [PATCH] 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. --- tabbox/tabboxhandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 57b6dafb81..a03dd5fe02 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -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); }