Check that canvas is valid.
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>
Tue, 6 Mar 2012 10:25:59 +0000 (11:25 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 12 Mar 2012 22:15:21 +0000 (23:15 +0100)
During creation the canvas might not have been set.

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

index 6c13377..45db9fa 100644 (file)
@@ -95,7 +95,7 @@ QAccessibleInterface *QAccessibleQuickItem::parent() const
         // QQuickView::declarativeRoot. The former is the true root item,
         // but is not a part of the accessibility tree. Check if we hit
         // it here and return an interface for the scene instead.
-        if (parent == canvas->rootItem()) {
+        if (canvas && (parent == canvas->rootItem())) {
             return QAccessible::queryAccessibleInterface(canvas);
         } else {
             return QAccessible::queryAccessibleInterface(parent);