summaryrefslogtreecommitdiff
path: root/src/controls/TabView.qml
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-05-06 16:52:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-07 12:28:12 +0200
commita84bb8aa5c24083c7ef54951a98bc62e7526da20 (patch)
tree6fedf5fbed51ebc030cf20bfbfbf12a1e4fc9bfb /src/controls/TabView.qml
parent574837306cbe95a0560882cefed16799752254bc (diff)
downloadqtquickcontrols-a84bb8aa5c24083c7ef54951a98bc62e7526da20.tar.gz
Handle invalid indexes for TabView.getTab
Return undefined if ListModel.get returned undefined instead of throwing an exception. Change-Id: I38cbd21472e8c409390e8269e5fa0a800106392e Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/TabView.qml')
-rw-r--r--src/controls/TabView.qml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml
index 3c6da297..5be224ce 100644
--- a/src/controls/TabView.qml
+++ b/src/controls/TabView.qml
@@ -137,7 +137,8 @@ FocusScope {
/*! Returns the \l Tab item at \a index. */
function getTab(index) {
- return __tabs.get(index).tab
+ var data = __tabs.get(index)
+ return data && data.tab
}
/*! \internal */