Skip to content

Commit

Permalink
LibGUI: Do not recurse into rows with invalid indices
Browse files Browse the repository at this point in the history
That would cause the traversal to go into an infinite loop.
  • Loading branch information
alimpfard authored and awesomekling committed Jul 1, 2020
1 parent bda39ef commit 476ccb2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Libraries/LibGUI/TreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ void TreeView::traverse_in_paint_order(Callback callback) const
return IterationDecision::Continue;
}

if (indent_level > 0 && !index.is_valid())
return IterationDecision::Continue;

++indent_level;
int row_count = model.row_count(index);
for (int i = 0; i < row_count; ++i) {
Expand Down

0 comments on commit 476ccb2

Please sign in to comment.