Skip to content

Commit

Permalink
Merge pull request #88917 from mihe/tree-selection-crash
Browse files Browse the repository at this point in the history
Fix crash when selecting re-added `TreeItem::Cell`
  • Loading branch information
akien-mga authored Feb 27, 2024
2 parents 7682bc3 + f7c1c83 commit 23191b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ void TreeItem::_change_tree(Tree *p_tree) {
}

if (tree->selected_item == this) {
for (int i = 0; i < tree->selected_item->cells.size(); i++) {
tree->selected_item->cells.write[i].selected = false;
}

tree->selected_item = nullptr;
}

Expand Down

0 comments on commit 23191b8

Please sign in to comment.