summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2012-11-28 13:22:54 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-16 19:43:32 +0100
commitf55ce226282ce1ff1c7c998b6d5552b908897d22 (patch)
tree97158334859a306e6a64fc9c25a82685c6e2c1c3 /src/plugins/platforms
parentff20caae2be743794a90f94128e454526e8b835f (diff)
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>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index c722ffb3bf..d5841c1983 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -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.