1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:25:06 +00:00

LibGUI: Do not recurse into rows with invalid indices

That would cause the traversal to go into an infinite loop.
This commit is contained in:
AnotherTest 2020-06-30 23:02:10 +04:30 committed by Andreas Kling
parent bda39ef7ab
commit 476ccb2206

View file

@ -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) {