diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 16188e30e..57fb030ea 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3021,7 +3021,12 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo } else { undo_redo->create_action(vformat(TTR("Set %s"), p_name), UndoRedo::MERGE_ENDS); undo_redo->add_do_property(object, p_name, p_value); - undo_redo->add_undo_property(object, p_name, object->get(p_name)); + + bool valid = false; + Variant value = object->get(p_name, &valid); + if (valid) { + undo_redo->add_undo_property(object, p_name, value); + } if (p_refresh_all) { undo_redo->add_do_method(this, "_edit_request_change", object, "");