From 31b4507cf46a4be8b15e52973cf132a51bf85870 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 18 Oct 2012 16:24:37 +0200 Subject: [PATCH] Be more careful about asserting in accessibility. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is possible to call the accessibility update for any widget, even if it doesn't implement the right interfaces. While that is bad, warning about it is better than asserting. Change-Id: I23c0c783083f73fb816d75b2c9b78efd603edcb6 Reviewed-by: Jan Arve Sæther --- src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index f69e2365d81..79d732504aa 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1023,7 +1023,11 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) case QAccessible::TextCaretMoved: { if (sendObject || sendObject_text_caret_moved) { QAIPointer iface = QAIPointer(event->accessibleInterface()); - Q_ASSERT(iface->textInterface()); + if (!iface->textInterface()) { + qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface << iface->object(); + return; + } + QString path = pathForInterface(iface); QDBusVariant cursorData; int pos = iface->textInterface()->cursorPosition();