Don't crash when requesting text.

Sometimes during initialization the QAccessibleItemRow will
still be in an invalid state.

Reviewed-by: Jan-Arve
(cherry picked from commit 90b4cf4b1aa0f70a62118e200e76dc1dc57985cc)
bb10
Frederik Gladhorn 2011-04-01 12:12:32 +02:00 committed by Olivier Goffart
parent 1422ce7ded
commit 2c7c8cf5d0
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}