Przeglądaj źródła

Fix editor inspector crashing when the old object is no longer valid

Aaron Franke 1 rok temu
rodzic
commit
2e7526af42
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      editor/editor_inspector.cpp

+ 3 - 1
editor/editor_inspector.cpp

@@ -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();