diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 44647596788..e40725fd94c 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -430,16 +430,16 @@ void TreeItem::remove_child(TreeItem *p_item) { *c = (*c)->next; aux->parent = nullptr; + + if (tree) { + tree->update(); + } return; } c = &(*c)->next; } - if (tree) { - tree->update(); - } - ERR_FAIL(); }