From a44fb35ca19805b5ff891125bbf81c8877f8acd7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 8 Mar 2024 16:06:42 +0100 Subject: [PATCH] Bakcported a change to the EditorInspector from: Implement polygons editors in the tiles selection mode - groud https://github.com/godotengine/godot/commit/cec004adf08fc57cd1d27408ee5b67637355f2e6 --- editor/editor_inspector.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, "");