From 90b4cf4b1aa0f70a62118e200e76dc1dc57985cc Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 1 Apr 2011 12:12:32 +0200 Subject: Don't crash when requesting text. Sometimes during initialization the QAccessibleItemRow will still be in an invalid state. Reviewed-by: Jan-Arve --- src/plugins/accessible/widgets/complexwidgets.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp index e638413..85be0b0 100644 --- a/src/plugins/accessible/widgets/complexwidgets.cpp +++ b/src/plugins/accessible/widgets/complexwidgets.cpp @@ -971,7 +971,11 @@ QString QAccessibleItemView::text(Text t, int child) const return QAccessibleAbstractScrollArea::text(t, child); QAccessibleItemRow item(itemView(), childIndex(child)); - return item.text(t, 1); + if (item.isValid()) { + return item.text(t, 1); + } else { + return QString(); + } } else { return QAccessibleAbstractScrollArea::text(t, child); } -- cgit v0.12