Skip to content

Commit

Permalink
Fix crash in tst_qtreewidget.
Browse files Browse the repository at this point in the history
A division by zero occurred since an empty model was used.

Task-number: QTBUG-28611

Change-Id: I1f9e869bda9f76a1c97840dff6ba48ab813bce9a
Reviewed-by: Janne Anttila <[email protected]>
Reviewed-by: Frederik Gladhorn <[email protected]>
  • Loading branch information
Friedemann Kleint authored and The Qt Project committed Jan 14, 2013
1 parent 4c8d8a7 commit 9941bf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/accessible/widgets/itemviews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ int QAccessibleTree::childCount() const

QAccessibleInterface *QAccessibleTree::child(int index) const
{
if ((index < 0) || (!view()->model()))
if (index < 0 || !view()->model() || !view()->model()->columnCount())
return 0;
int hHeader = horizontalHeader() ? 1 : 0;

Expand Down

0 comments on commit 9941bf5

Please sign in to comment.