Do not crash in the windows accessibility bridge
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Tue, 20 Dec 2011 12:32:01 +0000 (13:32 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 21 Dec 2011 23:47:03 +0000 (00:47 +0100)
If the object did not have a QAccessibleInterface subclass it would
crash in the windows accessibility bridge.

Change-Id: I931d69466a5a74a87f1c1c577fb1c918dcc8accf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
src/plugins/platforms/windows/qwindowsaccessibility.cpp

index 53d7b33..daf30ce 100644 (file)
@@ -1404,7 +1404,7 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QObject *o, int who, QAcce
     // An event has to be associated with a window,
     // so find the first parent that is a widget and that has a WId
     QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
-    QWindow *window = window_helper(iface);
+    QWindow *window = iface ? window_helper(iface) : 0;
 
     if (!window) {
         window = QGuiApplication::activeWindow();