Merge pull request #94101 from aaronfranke/fix-editor-insp-crash

Fix editor inspector crashing when the old object is no longer valid
This commit is contained in:
Rémi Verschelde 2024-07-17 11:43:11 +02:00
commit 69a8aed59a
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -3579,7 +3579,9 @@ void EditorInspector::edit(Object *p_object) {
next_object = p_object; // Some plugins need to know the next edited object when clearing the inspector.
if (object) {
object->disconnect(CoreStringName(property_list_changed), callable_mp(this, &EditorInspector::_changed_callback));
if (likely(Variant(object).get_validated_object())) {
object->disconnect(CoreStringName(property_list_changed), callable_mp(this, &EditorInspector::_changed_callback));
}
_clear();
}
per_array_page.clear();