Make sure we get a valid accessibleInterface in child_helper.
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>
Fri, 23 Mar 2012 18:28:12 +0000 (19:28 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Mar 2012 18:32:55 +0000 (19:32 +0100)
With filtering out more items from the tree of accessibles
make sure that if we get 0 returned we don't crash.

Change-Id: I7926ab66cd037952f7042dc46092cf5e2096d7c6
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
src/plugins/accessible/quick/qaccessiblequickview.cpp

index 4b31c2e..2df1f24 100644 (file)
@@ -127,7 +127,7 @@ static QQuickItem *childAt_helper(QQuickItem *item, int x, int y)
     }
 
     QScopedPointer<QAccessibleInterface> accessibleInterface(QAccessible::queryAccessibleInterface(item));
-    if (accessibleInterface->childCount() == 0) {
+    if (accessibleInterface && accessibleInterface->childCount() == 0) {
         return (itemScreenRect(item).contains(x, y)) ? item : 0;
     }