From a84bb8aa5c24083c7ef54951a98bc62e7526da20 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 6 May 2014 16:52:48 +0200 Subject: 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 --- src/controls/TabView.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/controls/TabView.qml') 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 */ -- cgit v1.2.1