From d54af5d3f61b832a606856d1f1ebad89ccb07f5f Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 20 Dec 2013 09:56:01 +0100 Subject: [PATCH] Prevent a crash when there is no accessible interface Change-Id: I058b76ff9d40b75eb51f9a6b1b89032ead629aed Reviewed-by: Liang Qi --- src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index 8e20a96a48..66c7727f15 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -240,7 +240,10 @@ // misc - (BOOL)accessibilityIsIgnored { - return QCocoaAccessible::shouldBeIgnored(QAccessible::accessibleInterface(axid)); + QAccessibleInterface *iface = QAccessible::accessibleInterface(axid); + if (!iface || !iface->isValid()) + return true; + return QCocoaAccessible::shouldBeIgnored(iface); } - (id)accessibilityHitTest:(NSPoint)point {