diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2018-01-30 20:00:42 +0100 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2018-01-30 20:25:14 +0100 |
commit | d664d6e634635e7386a9883b0058fba923769c66 (patch) | |
tree | 2d781830f39ec8e6d67b0a450ec40ed78842fd3e | |
parent | 20a52aa39db9a6e35738ee486848bd3dd28510cb (diff) |
ProjectSettings: Disallow adding properties without name.
-rw-r--r-- | editor/project_settings_editor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 704ec40e4c..058f517ae9 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -750,7 +750,16 @@ void ProjectSettingsEditor::_item_add() { String catname = category->get_text().strip_edges(); String propname = property->get_text().strip_edges(); - String name = catname != "" ? catname + "/" + propname : propname; + + if (propname.empty()) { + return; + } + + if (catname.empty()) { + catname = "global"; + } + + String name = catname + "/" + propname; undo_redo->create_action(TTR("Add Global Property")); |