Fix access to interface in QAccessibleEvent

Sometimes we get an invalid interface.
In that case the event should just return 0.
This avoids some potential crashes.

Change-Id: I9f166b5d5547dbe7f22c4756502aee811b0b80a6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
Frederik Gladhorn 2013-03-18 15:45:41 +01:00 committed by The Qt Project
parent f217172d6d
commit 206e8f67a0

View File

@ -1349,7 +1349,7 @@ QColor QAccessibleInterface::backgroundColor() const
QAccessibleInterface *QAccessibleEvent::accessibleInterface() const QAccessibleInterface *QAccessibleEvent::accessibleInterface() const
{ {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);
if (!iface) { if (!iface || !iface->isValid()) {
static bool hasWarned = false; static bool hasWarned = false;
if (!hasWarned) { if (!hasWarned) {
qWarning() << "Problem creating accessible interface for: " << m_object << endl qWarning() << "Problem creating accessible interface for: " << m_object << endl