Skip to content

Commit ba7b500

Browse files
committed
Merge pull request godotengine#102874 from YeldhamDev/fix_fav_no_parent
Fix error with favorited properties with open sub-inspectors
2 parents e5860ab + b31c85c commit ba7b500

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

editor/editor_inspector.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,13 +3832,16 @@ void EditorInspector::update_tree() {
38323832
ep->set_doc_path(doc_path);
38333833
ep->set_internal(p.usage & PROPERTY_USAGE_INTERNAL);
38343834

3835-
ep->update_property();
3836-
ep->_update_flags();
3837-
ep->update_editor_property_status();
3838-
ep->update_cache();
3839-
3840-
if (current_selected && ep->property == current_selected) {
3841-
ep->select(current_focusable);
3835+
// If this property is favorited, it won't be in the tree yet. So don't do this setup right now.
3836+
if (ep->is_inside_tree()) {
3837+
ep->update_property();
3838+
ep->_update_flags();
3839+
ep->update_editor_property_status();
3840+
ep->update_cache();
3841+
3842+
if (current_selected && ep->property == current_selected) {
3843+
ep->select(current_focusable);
3844+
}
38423845
}
38433846
}
38443847
}
@@ -3891,6 +3894,16 @@ void EditorInspector::update_tree() {
38913894

38923895
for (EditorProperty *ep : KV2.value) {
38933896
vbox->add_child(ep);
3897+
3898+
// Now that it's inside the tree, do the setup.
3899+
ep->update_property();
3900+
ep->_update_flags();
3901+
ep->update_editor_property_status();
3902+
ep->update_cache();
3903+
3904+
if (current_selected && ep->property == current_selected) {
3905+
ep->select(current_focusable);
3906+
}
38943907
}
38953908
}
38963909
}

0 commit comments

Comments
 (0)