Cocoa: make accessibility hit test not crash

Check if the accessibility element is valid before
calling childAt.

Change-Id: Id63c11f18b262c3c3a839db8ee2d11c0d7adc822
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Morten Johan Sørvig 2012-11-28 13:22:54 +01:00 committed by The Qt Project
parent ff20caae2b
commit f55ce22628

View File

@ -239,6 +239,10 @@ static QAccessibleInterface *acast(void *ptr)
if (!accessibleInterface)
return NSAccessibilityUnignoredAncestor(self);
if (!acast(accessibleInterface)->isValid())
return NSAccessibilityUnignoredAncestor(self);
QAccessibleInterface *childInterface = acast(accessibleInterface)->childAt(point.x, qt_mac_flipYCoordinate(point.y));
// No child found, meaning we hit this element.