summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Priyarup <ankitpriyarup@gmail.com>2019-01-29 22:21:50 +0530
committerAnkit Priyarup <ankitpriyarup@gmail.com>2019-01-29 22:21:50 +0530
commitee560dd987f5b6db27b903b6d911146b05514d60 (patch)
tree6ec3019c26739419e2544cbbbb1319ed9f43c442
parent92a3f11de6da26173cc44499b94290a5b70592b0 (diff)
Invalid node name should check if new_name is empty then cancel rename, fixes 25226
-rw-r--r--editor/scene_tree_editor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 7e4baa1533..6602d2974f 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -678,6 +678,11 @@ void SceneTreeEditor::_renamed() {
error->set_text(TTR("Invalid node name, the following characters are not allowed:") + "\n" + Node::invalid_character);
error->popup_centered_minsize();
+ if (new_name.empty()) {
+ which->set_text(0, n->get_name());
+ return;
+ }
+
which->set_text(0, new_name);
}