Check for parent item before calling functions on it.
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>
Tue, 6 Mar 2012 10:26:55 +0000 (11:26 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Mar 2012 11:11:57 +0000 (12:11 +0100)
Change-Id: Ic4066d133ef16ce8cf11fcb9fb5ddcc19599e85d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>

src/plugins/accessible/quick/qaccessiblequickitem.cpp

index 78e7ca8..6c13377 100644 (file)
@@ -278,7 +278,7 @@ QRect itemScreenRect(QQuickItem *item)
     // parent size. WE MIGHT HAVE TO REVISIT THESE FALLBACKS.
     if (itemSize.isEmpty()) {
         itemSize = QSize((int)item->implicitWidth(), (int)item->implicitHeight());
-        if (itemSize.isEmpty())
+        if (itemSize.isEmpty() && item->parentItem())
             // ### Seems that the above fallback is not enough, fallback to use the parent size...
             itemSize = QSize((int)item->parentItem()->width(), (int)item->parentItem()->height());
     }